Developer forum

Forum » Ecommerce - Standard features » Buy x get y with 50% discount

Buy x get y with 50% discount

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

We have received a request to create a discount that would offer an additional product (Y) with 50% discount if the user buys the main product (X).

I know I can add a discount that would give product Y for free but I am not sure if adding an Extender to this discount, I would be able to control the discount amount for product Y (50% instead of 100%).

Are there any options to achieve this?

Thank you,
Adrian


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Adrian

You can create a discount with 50% discount using an extender that will return true for the Y product if X is in the cart.

That should do the trick

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

I was actually thinking about that. What's missing though is an automatic add of Y product in the cart when X is added.

Can I use the extender for that part too? If X is in the cart, add product Y and activate the discount?

Thank you,
Adrian

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Yes - you can add the extra line - but it might not appear as a discount in the normal way. The alternative is to use 2 discounts - one adding the product Y, and the other giving half the price of prodyct Y as a negative discount (so it adds an amount). Kind of quirky.

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

I don't mind (or I hope the client won't mind) if it does not display as a discount.

I will try this approach as it seems cleaner.

Maybe it worths looking into extending the current discount logic to allow control of the discount for the extra product. Or maybe extend the "power" of the discount extender :)

I understand that it's not an easy fix but maybe keep that in mind for the next intervention on discounts. 

Thank you,
Adrian

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Adrian

We are planning a new discount and fee engine that should solve this and many other issues. And hopefully also make it a bit more user friendly.

The concept we are considering is 'rules' and 'rewards'. Create a new discount or fee instance and add any rules that needs to be met, and if they are met, apply any number of 'rewards'.

So something like this:

  • Discount 1 (Your example above)
    • Rules
      • Orderlines contains product X
    • Rewards
      • Add product Y to cart
      • Give 50% on product Y
  • Discount 2
    • Rules
      • If order voucher = 'freeshipping'
    • Rewards
      • Shipping fee = 0
  • Discount 3
    • Rules
      • If order total > 100
      • If shipping method = GLS
    • Rewards
      • Shipping fee = 0
  • Discount 4 / fee rule 1 (This example will force shipping method and add a forced add-on product to the cart)
    • Rules
      • If orderlines contains product Z (which is i.e. a large object)
    • Rewards
      • Shipping method = "big truck"
      • Add product Q to cart (which is i.e. a pallet)

Rules and rewards of course being configurable add-ins.

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,
Sounds very good. It will indeed cover a lot of scenarios.

We are looking forward to it.

Thank you,
Adrian

 

You must be logged in to post in the forum