Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
* @copyright ETS Software Technology Co., Ltd
|
||||
* @license Valid for 1 website (or project) for each purchase of license
|
||||
*/
|
||||
|
||||
|
||||
class Cart extends CartCore
|
||||
{
|
||||
/*
|
||||
@@ -53,4 +53,4 @@ class Cart extends CartCore
|
||||
}
|
||||
return $total;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,11 +28,11 @@ class CartController extends CartControllerCore
|
||||
{
|
||||
parent::postProcess();
|
||||
if(Tools::getIsset('addDiscount') && $this->errors && ($code = Tools::getValue('discount_name')) && Validate::isCleanHtml($code) && !CartRule::cartRuleExists($code)) {
|
||||
Module::getInstanceByName('ets_promotion')->addCartRule($this->errors,$code);
|
||||
Module::getInstanceByName('ets_promotion')->addCartRule($this->errors,$code);
|
||||
}
|
||||
if(Tools::isSubmit('deletePromotionDiscountRule') && ($id_ets_rule = Tools::getValue('deletePromotionDiscountRule')) && Validate::isUnsignedId($id_ets_rule) )
|
||||
{
|
||||
Module::getInstanceByName('ets_promotion')->deleteCartRule($id_ets_rule);
|
||||
Module::getInstanceByName('ets_promotion')->deleteCartRule($id_ets_rule);
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user