[-] FO : free gift fixed
This commit is contained in:
+3
-7
@@ -274,8 +274,6 @@ class CartCore extends ObjectModel
|
||||
|
||||
public function getCartRules()
|
||||
{
|
||||
// TODO : add cache
|
||||
|
||||
// If the cart has not been saved, then there can't be any cart rule applied
|
||||
if (!CartRule::isFeatureActive() || !$this->id)
|
||||
return array();
|
||||
@@ -307,15 +305,11 @@ class CartCore extends ObjectModel
|
||||
$row['description'] = $row['name'];
|
||||
}
|
||||
|
||||
// TODO Clean the following line, this line generate bug because getCartRule method not exists
|
||||
//$results = $this->getCartRule();
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function getDiscountsCustomer($id_cart_rule)
|
||||
{
|
||||
// Todo: see uses and change name
|
||||
if (!CartRule::isFeatureActive())
|
||||
return 0;
|
||||
|
||||
@@ -703,6 +697,9 @@ class CartCore extends ObjectModel
|
||||
'id_cart' => (int)$this->id
|
||||
)))
|
||||
return false;
|
||||
|
||||
if ((int)$cartRule->gift_product)
|
||||
return $this->updateQty(1, $cartRule->gift_product);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1303,7 +1300,6 @@ class CartCore extends ObjectModel
|
||||
|
||||
$order_total_products = $order_total;
|
||||
|
||||
// Todo: consider optimizations
|
||||
if ($type == Cart::ONLY_DISCOUNTS)
|
||||
$order_total = 0;
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ class OrderCartRuleCore extends ObjectModel
|
||||
'id_order' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_cart_rule' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_order_invoice' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'name' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true),
|
||||
'name' => array('type' => self::TYPE_STRING, 'validate' => 'isCleanHtml', 'required' => true),
|
||||
'value' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'required' => true),
|
||||
'value_tax_excl' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'required' => true)
|
||||
)
|
||||
|
||||
@@ -259,18 +259,6 @@ CREATE TABLE `PREFIX_cart_rule_combination` (
|
||||
PRIMARY KEY (`id_cart_rule_1`, `id_cart_rule_2`)
|
||||
);
|
||||
|
||||
CREATE TABLE `PREFIX_cart_rule_manufacturer` (
|
||||
`id_cart_rule` int(10) unsigned NOT NULL,
|
||||
`id_manufacturer` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_cart_rule`, `id_manufacturer`)
|
||||
);
|
||||
|
||||
CREATE TABLE `PREFIX_cart_rule_supplier` (
|
||||
`id_cart_rule` int(10) unsigned NOT NULL,
|
||||
`id_supplier` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_cart_rule`, `id_supplier`)
|
||||
);
|
||||
|
||||
CREATE TABLE `PREFIX_cart_rule_product_rule_group` (
|
||||
`id_product_rule_group` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_cart_rule` int(10) unsigned NOT NULL,
|
||||
|
||||
@@ -31,19 +31,6 @@ CREATE TABLE `PREFIX_category_shop` (
|
||||
|
||||
/* PHP:update_mailalerts_add_column_idshop(); */;
|
||||
|
||||
|
||||
CREATE TABLE `PREFIX_cart_rule_manufacturer` (
|
||||
`id_cart_rule` int(10) unsigned NOT NULL,
|
||||
`id_manufacturer` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_cart_rule`, `id_manufacturer`)
|
||||
);
|
||||
|
||||
CREATE TABLE `PREFIX_cart_rule_supplier` (
|
||||
`id_cart_rule` int(10) unsigned NOT NULL,
|
||||
`id_supplier` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_cart_rule`, `id_supplier`)
|
||||
);
|
||||
|
||||
CREATE TABLE `PREFIX_cart_rule_product_rule_group` (
|
||||
`id_product_rule_group` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_cart_rule` int(10) unsigned NOT NULL,
|
||||
@@ -56,4 +43,4 @@ INSERT INTO `PREFIX_cart_rule_product_rule_group` (`id_product_rule_group`, `id_
|
||||
);
|
||||
|
||||
ALTER TABLE `PREFIX_cart_rule_product_rule` CHANGE `id_cart_rule` `id_product_rule_group` int(10) unsigned NOT NULL;
|
||||
ALTER TABLE `PREFIX_cart_rule_product_rule` CHANGE `type` ENUM('products', 'categories', 'attributes', 'manufacturers', 'suppliers') NOT NULL;
|
||||
ALTER TABLE `PREFIX_cart_rule_product_rule` CHANGE `type` `type` ENUM('products', 'categories', 'attributes', 'manufacturers', 'suppliers') NOT NULL;
|
||||
|
||||
Reference in New Issue
Block a user