Buy X Get Y Specific V Overall


  • Default avatar
    gina47    
     11 years ago
    0

    Hi guy's.

    I may be missing something here but i'm having problems with the buy X get Y function.

    Customer would purchase item X (perfume) at or above $70 and (triggering an automatic coupon) would get item Y (free gift) added to cart automatically.

    In the coupon setup, i have selected X products as (perfumes) and set a specific value to $70. I can add perfume items but once the CART value is $70 then the coupon is activated regardless of the <$70 specific product amount being reached.
    eg, can add a makeup kit for $30 then a perfume (X product) of $45 and the auto-coupon will show the free gift. BUT adding just a $45 perfume (X product) will not trigger the coupon.

    Is this coupon triggering on the overall cart value and not the specific x product value?

    Thanks in advance

    J2.5.7
    AWO Pro 2.1.7
    VM2 (Puremart from Flexible Design)
  • Your avatar
    seyi    
     11 years ago
    0

    Hello,

    A little confused about your setup, are you saying you set the minimum value to 70 (specific) for a buy x get y coupon? And the coupon code is being triggered before the order total reaches 70 for the buy x products?
  • Default avatar
    gina47    
     11 years ago
    0

    Hi Seyi,

    Thanks for a quick reply.

    I sell cosmetics (perfumes, makeup, lipstick that sort of thing). I want to give customers a free gift if they buy $70 or more of perfume in any purchase. The cart can be a mixed cart of lipstick, makeup and perfume but ONLY get a free gift if the perfume/s is $70 or more.

    e.g:
    1 x lipstick $50 (no free gift)
    2 x lipstick $50 each (no free gift)
    2 x lipstick $50 each + 1 x perfume $15 (no free gift)
    1 x lipstick $50 + 1 x perfume $70 (free gift)
    2 x perfume $40 each (free gift)

    The logic would be: if, item X total, > $70, then, free (item Y) gift

    What I see happening though is once the overall CART total is $70 or above (ONLY WHEN INCLUDING AN item X PERFUME eg: $50 lipstick + $20 perfume) the coupon will trigger the free gift. It looks like the trigger is happening on the overall cart value and not the specific item X value.

    What is happening is this:
    e.g:
    1 x lipstick $50 (no free gift)
    2 x lipstick $50 each (no free gift)
    1 x perfume $50 (no free gift)
    1 x perfume $70 (free gift)
    1 x perfume $50 + 1 x lipstick $50 (FREE GIFT) This i think is wrong.


    My understanding of how (specific) works would be that the coupon would only trigger once the (specific) value for item X products has been reached in the cart.
    So if specific value is $70 then the coupon would trigger once the cart has one or more item X products equal or greater than $70 in single or total value.

    e.g:
    1 x perfume (item X) $30 + 1 x perfume (item X) $30 (no free gift)
    1 x perfume (item X) $35 + 1 x perfume (item X) $35 (free gift)
    1 x perfume (item X) $70 (free gift)
    1 x perfume (item X) $50 + 1 x lipstick $50 (no free gift)

    Have I misunderstood the process here?

    Thanks,
    Gina
  • Your avatar
    seyi    
     11 years ago
    0

    Hi Gina,

    Got it, thanks for the detailed explanation. I tested it and found it is adding the free product to the cart before 70 is reached, but is not discounting it, only discount after 70 is reached for perfumes.

    This will be fixed in the next update, but here is a solution you can apply now

    in www/administrator/components/com_awocoupon/helpers/estore/estorecouponhandler.php, around line 1090 is this:
    <?php
    $asset2list 
    $this->get_awocouponasset($coupon_row->id,$coupon_row->params->asset2_type,'2');
    ?>


    Right before that line, add this
    <?php
        
    if (!empty($coupon_row->params->min_value_type) && $coupon_row->params->min_value_type=='specific'
        
    && !empty($coupon_row->min_value) && round($specific_min_value,4)<$coupon_row->min_value ) {
            return 
    $this->return_false('errMinVal');
        }    
    ?>


    That should fix the problem.

  • Default avatar
    gina47    
     11 years ago
    0

    Hi Seyi,

    YES!!!

    This worked a treat.

    I did notice one little issue but I'm not sure if its AWO or VM.

    Once an automatic (buy X get Y) coupon is applied and the Y item is automatically added to the cart, if the customer changes the cart X product quantity then the Y product will remian in the cart.

    eg: Buy $100 of item X and get item Y for free.

    2 x item X product $50 each (free item Y is automatically added)

    Then the customer edits the cart to show
    1 x item X product $50 (and the free item Y remains in the cart).

    Is it possible to test the cart to see if an automatic coupon is applicable or not after the cart is edited?

    Thanks again for your great help.

    Gina.
  • Your avatar
    seyi    
     11 years ago
    0

    Hi Gina,

    The logic for buy x get y will only add products to the cart, it will never remove them. The discount will be removed if needed but not the product. The main reason is because you never know what the customer is thinking. He or she could have added that product themselves, and removing it would remove it in every situation, unless the customer qualifies for the buy x get y. In effect the customer could not purchase th get y products without first qualifying for the buy x.