Prestashop | Наценка через скидку | Как заставить работать оптовую цену в корзине
/classes/Cart.php
PHP:
if ($cart_rule['obj']->reduction_percent > 0 || $cart_rule['obj']->reduction_amount > 0) меняем на
PHP:
if ($cart_rule['obj']->reduction_percent != 0 || $cart_rule['obj']->reduction_amount > 0) /classes/CartRule.php
PHP:
'reduction_percent' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPercentage'), меняем на
PHP:
'reduction_percent' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat'), далее
PHP:
elseif ($cart_rule['reduction_percent'] > 0) меняем на
PHP:
elseif ($cart_rule['reduction_percent'] > -100) далее
PHP:
if ($this->reduction_percent && $this->reduction_product > 0) меняем на
PHP:
if ($this->reduction_percent && $this->reduction_product > -100) /controllers/admin/AdminCartRulesController.php
PHP:
if ((float)Tools::getValue('reduction_percent') < 0 || (float)Tools::getValue('reduction_percent') > 100) меняем на
PHP:
if ((float)Tools::getValue('reduction_percent') < -100 || (float)Tools::getValue('reduction_percent') > 100)
/admin/themes/default/template/controllers/cart_rules/actions.tpl
Все строчки
PHP:
getFieldValue($currentObject, 'reduction_percent')|floatval > 0 меняем на
PHP:
getFieldValue($currentObject, 'reduction_percent')|floatval > -100