how to disable cumulative coupons with prestashop cart rule coupons


  • Default avatar
    anne18    
     6 years ago
    0

    Hello,

    A client has entered a cart rule coupon (prestashop core coupon system) and a AWO coupon, and both were applied. How can I avoid cumulative coupons ?


    Anne

  • Your avatar
    seyi    
     6 years ago
    0

    Do you need coupons through prestashop core?  If not, you can just disable it in awocoupon->configuration
  • Default avatar
    anne18    
     6 years ago
    0

    Yes I need both prestashop coupons and awocoupon but they must not be cumulative.
  • Your avatar
    seyi    
     6 years ago
    0

    Hello,

    You can modify the override so if a prestashop coupon is used, the awocoupon function is not called.

    In the file www/override/classes/Cart.php, around line 43 is this:
    <?php
        
    public function getCartRules($filter CartRule::FILTER_ACTION_ALL) {
            if (!$this->id) return array();
            
            $discounts 
    parent::getCartRules($filter);
    ?>


    Right after that you can add this:
    <?php
            
    if(!empty($discounts)) return $discounts;
    ?>


    That should do it.
  • Default avatar
    anne18    
     6 years ago
    0

    thanks it's working !