From 8add301ef3cf4ca8a68cb55f7e49442ae56041b2 Mon Sep 17 00:00:00 2001 From: mDeflotte Date: Mon, 21 Nov 2011 08:12:48 +0000 Subject: [PATCH] // Bug with sql query to duplicate product from the cart git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10308 b9a71923-0436-4b27-9f14-aed3839534dd --- classes/Cart.php | 18 ++++++++++-------- classes/PaymentModule.php | 3 --- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/classes/Cart.php b/classes/Cart.php index 6d526d0cd..c9512ae21 100644 --- a/classes/Cart.php +++ b/classes/Cart.php @@ -2236,14 +2236,16 @@ class CartCore extends ObjectModel return false; // Duplicating cart_product line - $sql = 'INSERT INTO '._DB_PREFIX_.'cart_product values( - '.(int)$this->id.', - '.(int)$id_product.', - '.(int)$this->id_shop.', - '.(int)$id_product_attribute.', - '.(int)$quantity.', - NOW(), - '.(int)$new_id_address_delivery.')'; + $sql = 'INSERT INTO '._DB_PREFIX_.'cart_product + (`id_cart`, `id_product`, `id_shop`, `id_product_attribute`, `quantity`, `date_add`, `id_address_delivery`) + values( + '.(int)$this->id.', + '.(int)$id_product.', + '.(int)$this->id_shop.', + '.(int)$id_product_attribute.', + '.(int)$quantity.', + NOW(), + '.(int)$new_id_address_delivery.')'; Db::getInstance()->execute($sql); if (!$keep_quantity) diff --git a/classes/PaymentModule.php b/classes/PaymentModule.php index c32efd325..5d7779a77 100644 --- a/classes/PaymentModule.php +++ b/classes/PaymentModule.php @@ -120,10 +120,8 @@ abstract class PaymentModuleCore extends Module $package_list = $cart->getPackageList(); $cart_delivery_option = unserialize($cart->delivery_option); foreach ($delivery_option_list as $id_address => $package) - { if (!isset($cart_delivery_option[$id_address]) || !array_key_exists($cart_delivery_option[$id_address], $package)) die('Error: delivery option for some addresses is not defined'); - } $order_list = array(); $order_detail_list = array(); @@ -299,7 +297,6 @@ abstract class PaymentModuleCore extends Module $cartRulesList = ''; $result = $cart->getCartRules(); $cartRules = ObjectModel::hydrateCollection('CartRule', $result, (int)$order->id_lang); -// @todo How to menage cart rules, with multiple shipping? foreach ($cartRules as $cartRule) { $value = $cartRule->getContextualValue(true);