Disabled multiple coupons with Automatic coupons


  • Your avatar
    seyi    
     3 years ago
    0

    I disabled multiple coupons and it would not allow a coupon to be entered when the automatic coupon kicked in. I tried and it said that the coupon was accepted but it did not apply the discount. I ask because some people have figured out they can enter 2 coupons and are in a way abusing this. I put back to the settings you had put it at.
  • Your avatar
    seyi    
     3 years ago
    0

    Yes, there seems to be a problem with disabling multiple coupons and allowing auto coupons and 1 coupon to work. Here is a fix:

    in www/administrator/components/com_awocoupon/helpers/estore/estorecouponhandler.php, around line 225 is this:

    <?php
            
    if($this->params->get('enable_multiple_coupon'0)==0$coupon_awo_entered_coupon_ids = array(array_pop($coupon_awo_entered_coupon_ids));
    ?>


    Right before that enter this:
    <?php
            
    if(!empty($auto_code))  {
                foreach(
    $coupon_awo_entered_coupon_ids as $k=>$r) if($r==$auto_code->coupon_code) unset($coupon_awo_entered_coupon_ids[$k]);
            }
    ?>


    and around line 270 is this:
    <?php
            $master_output 
    $coupon_rows = array();
    ?>


    Right before that enter this:
    <?php
            
    if(!empty($auto_code))  {
                
    array_unshift($coupon_awo_entered_coupon_ids,$auto_code->coupon_code); 
            }
    ?>


    That should fix it.
  • Default avatar
    heraldinio    
     8 months ago
    0

    Hy Seyi,
    i've just bought and installed AwoCoupon version 2.4.6 , and when i use the Automatic discount the calculation is right but when i use a coupon (other than automatic ones) that have other discount, the calculation is wrong.

    In configuration settings i have:
    Enable Multiple Coupons
    Activate NO

    Should i modify the code as i see above or for my version should i make other changes?

    Thanks in advance
  • Your avatar
    seyi    
     8 months ago
    0

    Hello,

    No this is a different problem. Can you give more details about the coupon you are using, what you are seeing in the cart and what it should be?
  • Default avatar
    heraldinio    
     8 months ago
    0

    Hy, Seyi,
    I’ve made a coupon named “REDUCERE”.
    Process type: All that apply
    This is a PARENT coupon that contains 2 coupons:
    1) A coupon named “all15”, that is a 15 Percent coupon, discount type: specific
    that apply a 15 percent discount to all products excluding 1 category (darw)

    2) A coupon named “darw20”, that is a 20 Percent coupon, discount type: specific
    that apply a 20 percent ONLY to one category (darw) , the one excluded from the coupon “all15”
    After, I’ve set this parent coupon “REDUCERE” as Automatic Discount.
    Until now, when I place orders everything is just fine and the calculation is ok.

    Now, I want to make a campaign offering 30 discount to all the products, no matter of category.
    So, I’ve made a coupon named “HER30” , that is Percent, Discount Type: Overall, Value 30. This is NOT an Automatic Discount.

    When I apply manually this coupon I’m expecting to apply a 30% discount to all the products, and to ignore the Automatic discount “REDUCERE”. Unfortunately the calculation is not wright in this case.
    In AWOCoupon – Configuration , Enable Multiple Coupons - the activation setting is NO
    You can check on my website www.edituraherald.ro
    by adding to cart only one book, and to see the difference by applying “HER30” coupon instead of the automatic coupon.

    Do you have any idea how can I set those coupons in order to work as I wish ?
    Thanks for support
  • Your avatar
    seyi    
     8 months ago
    0

    Hello,

    Thanks for the detailed explanation. I understand now, however this is the wanted behavior. If you have multiple coupons disabled, it allows an automatic coupon as well as 1 normal coupon to work.

    If you do not want HER30 to work with any other coupons, you can add the tag "{exclusive}". This will kick out any other discounts in the cart and only process HER30:
    http://awodev.com/documentation/awocoupon-pro/coupons#category-tag

  • Default avatar
    heraldinio    
     8 months ago
    0

    Seyi, you are great!
    It works like a charm.
    Big thanks for all your support