Skip to content

PHP 8.x support for catalog/model/product.php#11430

Merged
mhcwebdesign merged 1 commit intoopencart:3.0.x.x_Maintenancefrom
mhcwebdesign:3.0.x.x_Maintenance
Jul 4, 2022
Merged

PHP 8.x support for catalog/model/product.php#11430
mhcwebdesign merged 1 commit intoopencart:3.0.x.x_Maintenancefrom
mhcwebdesign:3.0.x.x_Maintenance

Conversation

@mhcwebdesign
Copy link
Copy Markdown
Contributor

No description provided.

@mhcwebdesign mhcwebdesign merged commit 881341b into opencart:3.0.x.x_Maintenance Jul 4, 2022
@ADDCreative
Copy link
Copy Markdown
Contributor

@mhcwebdesign getPopularProducts also need updating, not that it is used by the core. I would do a pull request, but they just get closed for the 3.0.x.x_Maintenance branch.

$product_data = $this->cache->get('product.popular.' . (int)$this->config->get('config_language_id') . '.' . (int)$this->config->get('config_store_id') . '.' . $this->config->get('config_customer_group_id') . '.' . (int)$limit);
if (!$product_data) {
$query = $this->db->query("SELECT p.product_id FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) WHERE p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "' ORDER BY p.viewed DESC, p.date_added DESC LIMIT " . (int)$limit);
foreach ($query->rows as $result) {
$product_data[$result['product_id']] = $this->getProduct($result['product_id']);

@mhcwebdesign
Copy link
Copy Markdown
Contributor Author

@mhcwebdesign getPopularProducts also need updating, not that it is used by the core. I would do a pull request, but they just get closed for the 3.0.x.x_Maintenance branch.

$product_data = $this->cache->get('product.popular.' . (int)$this->config->get('config_language_id') . '.' . (int)$this->config->get('config_store_id') . '.' . $this->config->get('config_customer_group_id') . '.' . (int)$limit);
if (!$product_data) {
$query = $this->db->query("SELECT p.product_id FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) WHERE p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "' ORDER BY p.viewed DESC, p.date_added DESC LIMIT " . (int)$limit);
foreach ($query->rows as $result) {
$product_data[$result['product_id']] = $this->getProduct($result['product_id']);

Thanks for noticing it, it's now updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants