Coupon not checked when you change the items in your shopping cart

Started by Arkadiy, October 29, 2015, 05:25:10 AM

Previous topic - Next topic

Arkadiy

The situation:
Type of goods on 3000, into database there a coupon, valid from 3000, enter this coupon. After that, reduce the number of goods. The purchase amount is less, but the coupon is not removed.

Solution:

In the function checkoutData() of the class VirtueMartCart when you change the goods in the cart the coupon will not be checked. To ensure that the coupon was checked before

if (!empty($this->couponCode)) {

insert

if (empty($this->couponCode) && !empty(self::$_cart->cartData["couponCode"])) {
   $this->couponCode = self::$_cart->cartData["couponCode"];
}

and in the redirect

if (!empty($redirectMsg)) {
    $this->couponCode = '';
    $this->_inCheckOut = false;
    $this->setCartIntoSession();

//doesn't work the first time
    //return $this->redirecter('index.php?option=com_virtuemart&view=cart'.$layoutName , $redirectMsg);
//its work
     JFactory::getApplication()->redirect('index.php?option=com_virtuemart&view=cart'.$layoutName , $redirectMsg);
   }

The modified file can provide.


jjk

Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations