Developer forum

Forum » Development » product discount quantity - on product page calculate by quantity - not first in cart

product discount quantity - on product page calculate by quantity - not first in cart

Jan Sangill
Reply

Hi,

I have a question. It might be me overlooking something very simple. I hope it is.

If a product quantity discount is applied with x percent in backend.

Then when we goto the productpage - I need to be able to show the correct price - if the user inputs 5 in Quantity input field.

At the moment this is shown in cart only when applying it with quantity. Any way this can be done on productpage  - in a simple way?

//jan

 

 


Replies

 
Nicolai Pedersen
Reply

Hi Jan

You cannot with quantity discounts - most other product discounts will show up. An alternative is to use quantity prices instead of quanity discounts. Then you can render a table of prices per piece depending on the quantity. See this section: https://doc.dynamicweb.com/documentation-9/ecommerce/product-catalog/products#2828

If you provide prices for each quantity step, you will get a loop on the product detail you can show.

BR Nicolai

 
Jan Sangill
Reply

Hi Nikolai, TY for the fast feedback!

I will see if this is a viable solution for us.

 
Anders Ebdrup
Anders Ebdrup
Reply

Dear Nicolai,

 

We have the exact same challenge here and have moved the quantity from the standard field to a custom field in order to handle the logic in a DiscountExtender, but we cannot identify whether the call to the method DiscountValidForProduct origin from a product display or a cart calculation.

Can this be added or do someone have a way to display potential discounts for products?

 

Best regards,

Anders

 
Nicolai Pedersen
Reply

That would be a breaking change, so not an easy quickfix.

You could also use the feature that Dynamicweb has that was created for quantity prices...

 
Anders Ebdrup
Anders Ebdrup
Reply

Dear Nicolai,

 

Al right, we are going to try to solve it with a context variable that we are setting in: BeforeDiscountCalculation and removing again in AfterDiscountCalculation, then we can do the magic in our DiscountExtender.

 

Best regards, Anders

 

You must be logged in to post in the forum