Parent Coupon Problem


  • Default avatar
    zoray2    
     2 years ago
    0

    I've created a parent coupon for varying discounts depending on the category. However, if the customer mixes the categories in on order, it takes the discount off of the entire order instead of the appropriate categories (big problem!)
    For instance, if I have 25% off most categories, 10% off one category, and one category not on sale at all; then the client buys one of each, they either get "lowest applicable" (10% off the entire order, they complain); or "all that apply" (25% + 10% off the entire order, losing lots of money here).
    How can I set this so that they get the appropriate discount for each different item they order?
    1 item = $25%
    1 item = 10%
    and 1 item at full price.
    Please help!
    Z
  • Your avatar
    seyi    
     2 years ago
    0

    Hello,

    For each category coupon, make sure 'Discount Type' is set to 'specific':
    http://awodev.com/documentation/awocoupon-pro/coupons#discount-type
  • Default avatar
    zoray2    
     2 years ago
    0

    It is. This just doesn't work where products are in multiple categories, does it? You can't, for instance, exclude the entire category "Silver" if silver items are also included in say, "Clasps" or "Earrings"?
  • Your avatar
    seyi    
     2 years ago
    0

    Ok, understand now.

    In a category selection, if a product belongs to that category, regardless of if it belongs to any other it is included in the coupon. So there are 2 choices:
    - select the products individually in the coupon
    - create a new categories for each coupon adding the appropriate products and use those instead

    Those give you total control
    If you just want 1 coupon to be applied max per product, here is what you can do:

    In the latest version of AwoCoupon there is commented out code in
    www/administrator/components/com_awocoupon/helpers/estore/estorecouponhandler.php, around line 766:

    <?php
            
    /* # stop product from being discounted more than once in the cart
            //foreach($coupon_row->cart_items as $k=>$a) { if(!empty($a['totaldiscount'])) unset($coupon_row->cart_items[$k]); }
            //if(empty($coupon_row->cart_items)) return;
            foreach($coupon_row->cart_items_breakdown as $k=>$a) { if(!empty($a['totaldiscount'])) unset($coupon_row->cart_items_breakdown[$k]); }
            if(empty($coupon_row->cart_items_breakdown)) return;
            */
    ?>


    Simply uncomment it like this:
    <?php
            
    # stop product from being discounted more than once in the cart
            //foreach($coupon_row->cart_items as $k=>$a) { if(!empty($a['totaldiscount'])) unset($coupon_row->cart_items[$k]); }
            //if(empty($coupon_row->cart_items)) return;
            
    foreach($coupon_row->cart_items_breakdown as $k=>$a) { if(!empty($a['totaldiscount'])) unset($coupon_row->cart_items_breakdown[$k]); }
            if(empty(
    $coupon_row->cart_items_breakdown)) return;
            
    ?>


    This solution will affect all coupons. So if or example you have a 10% coupon overall and a normal gift certificate, you would only be able to use one in the order.
  • Default avatar
    zoray2    
     2 years ago
    0

    Thank you! Did manage to get it working by narrowing down the categories.
    Z