// 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
This commit is contained in:
+10
-8
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user