[-] BO : voucher creation in the order detail fixed

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12718 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
dMetzger
2012-01-26 14:34:58 +00:00
parent 265b61588e
commit b274997203
3 changed files with 59 additions and 22 deletions
+11 -2
View File
@@ -692,10 +692,19 @@ class CartCore extends ObjectModel
public function addCartRule($id_cart_rule)
{
return Db::getInstance()->insert('cart_cart_rule', array(
// You can't add a cart rule that does not exist
$cartRule = new CartRule($id_cart_rule, Context::getContext()->lang->id);
if (!Validate::isLoadedObject($cartRule))
return false;
// Add the cart rule to the cart
if (!Db::getInstance()->insert('cart_cart_rule', array(
'id_cart_rule' => (int)$id_cart_rule,
'id_cart' => (int)$this->id
));
)))
return false;
return true;
}
public function containsProduct($id_product, $id_product_attribute = 0, $id_customization = false, $id_address_delivery = 0)