Jump to content

Problem with cart rules


Presta-Master

Recommended Posts

First problem: First product in cart has not Special price, but secend has. 

 

CartRule.php
Take a look on this function
        if ($this->reduction_exclude_special) {
            $products = $context->cart->getProducts();
            $is_ok = false; // should be true;
            foreach ($products as $product) {
                if (!$product['reduction_applies']) { // should be if ($product['reduction_applies'])
                    $is_ok = true; // should be false
                    break; 
                }
            }
            if (!$is_ok) {
                return (!$display_error) ? false : $this->trans('You cannot use this voucher on products on sale', array(), 'Shop.Notifications.Error');
            }
        }

 

Correct function
        if ($this->reduction_exclude_special) {
            $products = $context->cart->getProducts();
            $is_ok = true;
            foreach ($products as $product) {
                if ($product['reduction_applies']) {
                    $is_ok = false;
                    break;
                }
            }
            if (!$is_ok) {
                return (!$display_error) ? false : $this->trans('You cannot use this voucher on products on sale', array(), 'Shop.Notifications.Error');
            }
        }
 

Secend problem:
Customer add voucher to cart next add products with special price. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...