после:
Код:
'.Shop::addSqlAssociation('product', 'p').'
добавить:
Код:
'.Product::sqlStock('p', 0).'
после:
Код:
WHERE product_shop.`active` = 1
добавить:
Код:
AND (p.`quantity` > 0 OR IFNULL(stock.quantity, 0) > 0 OR IFNULL((SELECT SUM(`quantity`) FROM `'._DB_PREFIX_.'product_attribute` WHERE p.`id_product` = `id_product`), 0) > 0)
Код:
$sql->where('product_shop.`active` = 1');
заменить на:
Код:
$sql->where('product_shop.`active` = 1 AND (p.`quantity` > 0 OR IFNULL(stock.quantity, 0) > 0 OR IFNULL((SELECT SUM(`quantity`) FROM `'._DB_PREFIX_.'product_attribute` WHERE p.`id_product` = `id_product`), 0) > 0)');