Issues 21.09.2013 cart, code, fix, gift, issue, voucher

PrestaShop - problems with gift voucher fixed!

We are pleased to inform that boring issue with gift vouchers are fixed! Just apply this path to your store and everything will be allright

Unfortunately in PrestaShop 1.5.5 is a litle bug related to voucher codes. If you add gift voucher code - all other voucher codes will not work and also vouchers feature (form, remove voucher codes) will not work anymore. Here is the solution for this issue.

 

Fixed feature - gift vouchers and prestashop shopping cart

prestashop gift voucher cart

 

Gift voucher code fix for PrestaShop 1.5.5

Open file: classes/Cart.php. This is a class which handle all important cart functions.  In my opinion is the one from the most important things in whole shop. You can find there function named addCartRule near line 761. All what we have to do is a little modification.

 

remove code:

if (Db::getInstance()->getValue('SELECT id_cart_rule FROM '._DB_PREFIX_.'cart_cart_rule WHERE id_cart = '.(int)$this->id))
return false;

and replace it with:

$result = Db::getInstance()->getRow('SELECT id_cart_rule FROM '._DB_PREFIX_.'cart_cart_rule WHERE id_cart = '.(int)$this->id
. ' AND id_cart_rule = '.(int)$id_cart_rule);
if ($result && Db::getInstance()->NumRows()) return false;

 

 

Zdjęcie autora: Milosz Myszczuk

Artykuł napisany przez Milosza Myszczuka, eksperta PrestaShop i oficjalnego moderatora społeczności PrestaShop. CEO i założyciel agencji interaktywnej VEKIA. Dowiedz się więcej.

If you like this article, support our work!

Comments