discount on product groups depending on quantity


  • Default avatar
    a123123    
     3 months ago
    0

    Hi there,


    We need to create some automatic discounts in order to have some fixed price depending on qty in cart (all the products in the store have the same price (eg. 56 USD)) and we want that every 2 products to cost => 104 USD and every 3 products => 149 USD.


    We are not sure how we should do this in a correct way. We tried different setup with different/ multiple coupons, but still not working as expected (we have the last version of AwoCoupon and Joomla 3.9.23 with VM 3.8.6)


    more examples:

    5 products in cart => 149 (group of 3) + 104 (group of 2)

    6 products in cart => 149 (group of 3) + 149 (group of 3)

    7 products in cart => 149 (group of 3) + 149 (group of 3) + 56 (product left alone)

    8 products in cart => 149 (group of 3) + 149 (group of 3) + 104 (group of 2)

    and so on...

    - in cart could be the same product or different products - only the quantity matters here.

    Do you have any idea on how we could acomplish something like this?

  • Your avatar
    seyi    
     3 months ago
    0

    Seems to me you could create 2 buy x get y coupons to cover this:

    Coupon A: Buy X Get Y
      Buy X: 2, select vendor
      Get Y: 1, select Vendor
      Value: Amount discount of 19

    Coupon B: Buy X Get Y
      Buy X: 1, select vendor
      Get Y: 1, select vendor
      Value: Amount discount of 8

    Coupon C: combination coupon were you combine coupons A and B and set process type to All that apply.  Order coupon A before coupon B so it process that first if it applies.

  • Default avatar
    a123123    
     3 months ago
    0

    Hi, thank you for your reply.

    I tried this way after your suggestion, but it still not working as expected.


    Now we have for any 2 products a discount of 8.

    And when 3 or more products are in the cart, there is 27 (like both of them 19 + 8) and discount remains 27 no matter of how many products are there.


    Maybe is there something else I could check?

    ---

    I have created the coupons A, B, C as you said

    coupon C was set as automatic

    ---

    in case it helps:

    https://photos.google.com/share/AF1QipMJ-117cZtzZEypXYExatoAQa6Ee2d7Pd0r5hRcXxS0s_iF-gLPiMun8uBGJnC0xw?key=Z3pQeWdvUml6ZGtfX3RyaFZxWjJYdE5OX2xMaGhn

  • Your avatar
    seyi    
     3 months ago
    0

    Hello,

    So you are having multiple discounts on all products.  There is this setting that will solve that:
      awocoupon > configuration > multiple coupons > Apply only one discount per product  = 'yes'

    This will force a maximum of 1 discount for each product in the cart.  This is a global feature, so once changed the behavior works with all shopping carts.
  • Default avatar
    a123123    
     3 months ago
    0

    We set that accordingly.

    But if we use the amount with value 19, respectively 8 then the discount is 27 for 6 or more products in cart - it is not replicated.


    Right now we figured it out and it is working with this method (using percentage):


    Coupon A => Discount value - percent 33.92857 (which is the difference - in percentage - between 56 * 3 and 149 multiplied by 3)

    Coupon B => Discount value - percent 14.28571 (which is the difference - in percentage - between 56 * 2 and 104 multiplied by 2)


    My last question:

    Is somehow possible to achieve the same result using the amount as value instead of percentage?

    Because with some or different promo/ prices I think we should expect problems with the precision / decimals.

  • Your avatar
    seyi    
     3 months ago
    0

    I do not understand.  Why is it not working?  Can you give some examples of what is happening with amount?
  • Default avatar
    a123123    
     3 months ago
    0

    First of all, thank you for your time and the great job you are doing.


    Getting back to the situation:

    If we use it with amount and many products in the cart then the coupon C is applied twice, first for coupon A and second for coupon B.


    I've looked into session and this is what I've found

    ...

    [processed_coupons] => Array (

        [6] => Array (

            [coupon_id_entered] => 8

            [coupon_code] => coupon C

            [orig_coupon_id] => 6

            [orig_coupon_code] => coupon A

            [product_discount] => 19.00000

            ...

        )

        [7] => Array (

            [coupon_id_entered] => 8

            [coupon_code] => coupon C

            [orig_coupon_id] => 7

            [orig_coupon_code] => coupon B

            [product_discount] => 8.00000

            ...

        )

    )

    ...

    And we have 8 * $56 - $27 (where $27 is the actual discount from coupon C)

    but the result I was expected is a total discount of $46

    because we have 8 products and we wanted them grouped as 3 ($19), 3 ($19), 2 ($8) for this promo.

  • Your avatar
    seyi    
     3 months ago
    0

    Ok, the way I got it to work with amount discount, which would still require decimals, is:

    Buy1Get1
      Value: 8/2=4  Amount per item
      Apply discount to: Both BuyX and GetY

    Buy2Get1
      Value: 19/3=6.3333 Amount per item
      Apply discount to: Both BuyX and GetY


  • Default avatar
    a123123    
     3 months ago
    0

    Thank you, it works and it's easier to manage them like this.

    That would be all,


    I hope that our discussion would help others if they would find themselves in this situation.

    And in the future if we would encounter problems with totals I think of some adjustments to the final discount value;

    Eg.: if for some reason the total discount is calculated at 99.9998 and we need 100 I will create a plugin or add some code to round that correctly.


    Thank you for helping us to sort this out.

    Have a great weekend!

  • Your avatar
    seyi    
     3 months ago
    0

    You really should not need a plugin.  Internally AwoCoupon works in 4 decimal places, and then rounds the final value to what is configured in your store, normally 2 decimal places.  If the total happens to be 99.9998, this would automatically round up to 100 for 2 decimals.
  • Default avatar
    a123123    
     3 months ago
    0

    That sounds great, thank you for leting us know