From 9a36da86f3f7dea07d3308fc19880765d880f2fa Mon Sep 17 00:00:00 2001 From: artembaharev Date: Mon, 13 Aug 2018 12:50:39 +0500 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BE=D0=BF=D0=B5=D1=87=D0=B0=D1=82=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=B2=20shopProductsCollection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/classes/shopProductsCollection.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/classes/shopProductsCollection.class.php b/lib/classes/shopProductsCollection.class.php index dded6c0ee..655372bd7 100644 --- a/lib/classes/shopProductsCollection.class.php +++ b/lib/classes/shopProductsCollection.class.php @@ -118,7 +118,7 @@ protected function prepare($add = false, $auto_title = true) // We use main SKU price if it's not filtered out; // otherwise min of all remaining SKU prices. $sku_price = 'MIN(ps1.primary_price)'; - $main_sku_price = 'MAX(IF(ps1.id=p.id, ps1.primary_price, -1))'; + $main_sku_price = 'MAX(IF(ps1.product_id=p.id, ps1.primary_price, -1))'; $main_sku_exists = '-1 < '.$main_sku_price; $this->order_by = "IF($main_sku_exists, $main_sku_price, $sku_price) $order";