Developer forum

Forum » Ecommerce - Standard features » Creating a DiscountExtender for buy X get n*Y

Creating a DiscountExtender for buy X get n*Y

Justin Sjouw Dynamicweb Employee
Justin Sjouw
Reply

Hi,

I have setup a custom project for extending a discount wit a class based on DiscountExtenderBase. I'm able to call the Extender, and read the parameter.

The logic of when the dicount applies does not really change, so my thought is there I can just return base.DiscountValidForProduct(product).

But then I'm a bit stuck in understanding how I would change the amount of Y that is added to the basket for free.

I'm looking at the IDiscountExtenderCalculateProductDiscount but there (logically) I find everything around prices, but not the quantiy that is added to cart.

Am I on the right track here, or do I need to look in another place?

Thanks,

Justin

 

 


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Justin

I do not think you can do that - at least not using a discountextender.

You have to find another approach - i.e. manipulating the qty of the orderline given based on a notification or similar

 

You must be logged in to post in the forum