From 84dc75f57e49b2e494168ba327b89dfab8d8d4a5 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 23 Sep 2013 16:32:38 +0200 Subject: [PATCH] [-] CORE : Fix bug #PSCFV-10471 Cart item count problem, unique_id grouping error for id_product and id_product_attribute --- classes/Cart.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/Cart.php b/classes/Cart.php index d19fb0ab0..83d4b8be0 100644 --- a/classes/Cart.php +++ b/classes/Cart.php @@ -429,7 +429,7 @@ class CartCore extends ObjectModel product_shop.`available_for_order`, product_shop.`price`, product_shop.`active`, product_shop.`unity`, product_shop.`unit_price_ratio`, stock.`quantity` AS quantity_available, p.`width`, p.`height`, p.`depth`, stock.`out_of_stock`, p.`weight`, p.`date_add`, p.`date_upd`, IFNULL(stock.quantity, 0) as quantity, pl.`link_rewrite`, cl.`link_rewrite` AS category, - CONCAT(cp.`id_product`, IFNULL(cp.`id_product_attribute`, 0), IFNULL(cp.`id_address_delivery`, 0)) AS unique_id, cp.id_address_delivery, + CONCAT(LPAD(cp.`id_product`, 10, 0), LPAD(IFNULL(cp.`id_product_attribute`, 0), 10, 0), IFNULL(cp.`id_address_delivery`, 0)) AS unique_id, cp.id_address_delivery, product_shop.`wholesale_price`, product_shop.advanced_stock_management, ps.product_supplier_reference supplier_reference'); // Build FROM @@ -497,7 +497,7 @@ class CartCore extends ObjectModel p.`upc` AS upc, product_shop.`minimal_quantity` AS minimal_quantity' ); $result = Db::getInstance()->executeS($sql); - +d($result); // Reset the cache before the following return, or else an empty cart will add dozens of queries $products_ids = array(); $pa_ids = array();