any help place
I also like to add a watermark in the picture any help
I using 1.4.8b
Thank you
all the experts who take the time to read this post
God Bless you all.
nice work Opencart team

Code: Select all
public function getBestSellerProducts($limit) {
..........
}
Code: Select all
public function getBestSellerProducts($limit) {
//$product_data = $this->cache->get('product.bestseller.' . $this->config->get('config_language_id') . '.' . (int)$this->config->get('config_store_id') . '.' . $limit);
//if (!$product_data) {
$product_data = array();
$query = $this->db->query("SELECT op.product_id, SUM(op.quantity) AS total FROM " . DB_PREFIX . "order_product op LEFT JOIN `" . DB_PREFIX . "order` o ON (op.order_id = o.order_id) WHERE o.order_status_id > '0' GROUP BY op.product_id ORDER BY rand() DESC LIMIT " . (int)$limit);
foreach ($query->rows as $result) {
$product_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) WHERE p.product_id = '" . (int)$result['product_id'] . "' AND p.status = '1' AND p.date_available <= NOW() AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "'");
if ($product_query->num_rows) {
$product_data[] = $product_query->row;
}
}
$this->cache->set('product.bestseller.' . $this->config->get('config_language_id') . '.' . (int)$this->config->get('config_store_id') . '.' . $limit, $product_data);
//}
return $product_data;
}
Thank you So much QQphoria wrote:random best sellers:
1. EDIT: catalog/model/catalog/product.php
2. FIND & REPLACE THE ENTIRE FUNCTION:WITH:Code: Select all
public function getBestSellerProducts($limit) { .......... }
Code: Select all
public function getBestSellerProducts($limit) { //$product_data = $this->cache->get('product.bestseller.' . $this->config->get('config_language_id') . '.' . (int)$this->config->get('config_store_id') . '.' . $limit); //if (!$product_data) { $product_data = array(); $query = $this->db->query("SELECT op.product_id, SUM(op.quantity) AS total FROM " . DB_PREFIX . "order_product op LEFT JOIN `" . DB_PREFIX . "order` o ON (op.order_id = o.order_id) WHERE o.order_status_id > '0' GROUP BY op.product_id ORDER BY rand() DESC LIMIT " . (int)$limit); foreach ($query->rows as $result) { $product_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) WHERE p.product_id = '" . (int)$result['product_id'] . "' AND p.status = '1' AND p.date_available <= NOW() AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "'"); if ($product_query->num_rows) { $product_data[] = $product_query->row; } } $this->cache->set('product.bestseller.' . $this->config->get('config_language_id') . '.' . (int)$this->config->get('config_store_id') . '.' . $limit, $product_data); //} return $product_data; }
Users browsing this forum: No registered users and 8 guests