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

[Решено] Вывод в модуль новинки только товаров в наличии


ilerok
 Share

Recommended Posts

Подскажите, что допилить в коде модуля новинок, что бы в нем выводились только товары которые в наличии?

 

Просто ужасно тупо получается кода там выводятся товары не в наличии которые( 

 

Уверен, вопросы очень актуален для всех. Или не ужели я один кто это заметил?))

Link to comment
Share on other sites


как вариант

в контроллере модуля

        $filter_data = array(
            'sort'  => 'p.date_added',
            'order' => 'DESC',
            'start' => 0,
            'limit' => $setting['limit'],
            'filter_quantity' => 1 //добавить
        );

в модели  catalog/model/catalog/prodluct.php

в методе  getProducts()  после

		if (!empty($data['filter_manufacturer_id'])) {
			$sql .= " AND p.manufacturer_id = '" . (int)$data['filter_manufacturer_id'] . "'";
		}

добавить

                if (!empty($data['filter_quantity'])) {
			$sql .= " AND p.quantity > 0  ";
		}

 

  • +1 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • 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.