From a0f787ea32c618195089b3ef12e40c3e86dfdf14 Mon Sep 17 00:00:00 2001 From: aFolletete Date: Sat, 3 Dec 2011 09:56:38 +0000 Subject: [PATCH] // Comment useless line in order to clean this // Add table and identifier to CartRule class --- classes/Cart.php | 5 +++-- classes/CartRule.php | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/classes/Cart.php b/classes/Cart.php index 4b5d57371..16690ecf5 100644 --- a/classes/Cart.php +++ b/classes/Cart.php @@ -321,7 +321,8 @@ class CartCore extends ObjectModel $row['description'] = $row['name']; } - $results = $this->getCartRule(); + // TODO Clean the following line, this line generate bug because getCartRule method not exists + //$results = $this->getCartRule(); return $result; } @@ -825,7 +826,7 @@ class CartCore extends ObjectModel /* Add product to the cart */ else { - $sql = 'SELECT stock.out_of_stock, IFNULL(stock.quantity, 0) + $sql = 'SELECT stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity FROM '._DB_PREFIX_.'product p '.Product::sqlStock('p', $id_product_attribute, true, $shop).' WHERE p.id_product = '.$id_product; diff --git a/classes/CartRule.php b/classes/CartRule.php index e4f8d5be2..98153d8ec 100644 --- a/classes/CartRule.php +++ b/classes/CartRule.php @@ -62,6 +62,9 @@ class CartRuleCore extends ObjectModel 'identifier' => 'id_cart_rule', ); + protected $table = 'cart_rule'; + protected $identifier = 'id_cart_rule'; + protected $fieldsRequired = array('date_from', 'date_to'); protected $fieldsSize = array('code' => 254, 'description' => 65534); protected $fieldsValidate = array(