Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Страница "Все рекомендуемые товары" 1.0

   (0 reviews)    Find their other files

  90 3,126

2 Screenshots




  • +1 1

About This File

С помощью данного модуля появляется страница, на которой выводятся все товары из модуля "Рекомендуемые".

Тестировалось на Opencart 1.5.6.4 и Opencart 2.0.3

Демо

2.0.x

1.5.x

Установка

Скопируйте каталог "catalog" их архива в корень Вашего сайта.

ВНИМАНИЕ!!! При копировании происходит замена модели "catalog/model/catalog/product.php", если Вы не хотите заменять данную модель вставьте следующий код в модель "catalog/model/catalog/product.php" перед последней закрывающей "}":

// FOR FEATURED PAGEpublic function getProductFeatured($pid = array(), $data = array()) {if ($this->customer->isLogged()) {$customer_group_id = $this->customer->getCustomerGroupId();} else {$customer_group_id = $this->config->get('config_customer_group_id');} $sql = "SELECT DISTINCT p.product_id, (SELECT AVG(rating) FROM " . DB_PREFIX . "review r1 WHERE r1.product_id = p.product_id AND r1.status = '1' GROUP BY r1.product_id) AS rating 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.status = '1'";$sql .=  " AND p.product_id IN (" . implode(',', $pid) . ")";$sql .= " AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "' GROUP BY p.product_id";$sort_data = array('pd.name','p.model','p.price','rating','p.sort_order');if (isset($data['sort']) && in_array($data['sort'], $sort_data)) {if ($data['sort'] == 'pd.name' || $data['sort'] == 'p.model') {$sql .= " ORDER BY LCASE(" . $data['sort'] . ")";} else {$sql .= " ORDER BY " . $data['sort'];}} else {$sql .= " ORDER BY p.sort_order"; }if (isset($data['order']) && ($data['order'] == 'DESC')) {$sql .= " DESC, LCASE(pd.name) DESC";} else {$sql .= " ASC, LCASE(pd.name) ASC";}if (isset($data['start']) || isset($data['limit'])) {if ($data['start'] < 0) {$data['start'] = 0;} if ($data['limit'] < 1) {$data['limit'] = 20;} $sql .= " LIMIT " . (int)$data['start'] . "," . (int)$data['limit'];}$product_data = array();$query = $this->db->query($sql);foreach ($query->rows as $result) {  $product_data[$result['product_id']] = $this->getProduct($result['product_id']);}return $product_data;}/// // FOR FEATURED PAGE
 



User Feedback

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.