How to Display/Output Product Volume Discount on Product Details Page or Shop Cart?

Is there a way to display or output the volume discount in the shop cart or product details page when the volume discount kicks in?

For example, I have a product with the price of $295 with the volume discount setup that when customers order 2 or more, they will get $10 OFF each unit. So it will be $285 for two ore more of the same product. I then want to display or output on the page the the discount they receive, in this example the $20 discount when they enter 2 as the quantity?

This is possible, but it’s a little tricky as the shopping cart data object ( shopping_cart ) doesn’t specify that a volume discount was applied, only what the resulting purchase price was. So you’d have to loop through the shopping cart items - match against the current product - then compare the sell price to the order/cart price - calculate the difference and then output it.

On the product detail page this can probably all be done with Liquid since the whole layout updates after an ‘add to cart’ event.
But on other layouts and the shopping cart page, if the cart quantities are changed, custom Liquid will not update unless the page is refreshed. Otherwise, you’d need to use Javascript to listen for the ‘add to cart’ event ( eCommerce Javascript ) and calculate/output the discount with Javascript.

Additionally, on the product detail page, you probably want to show the discount BEFORE they’ve added anything to the cart - just when they are adjusting the quantity field. So this would also require Javascript to listen for those changes, check through the discount brackets and calculate the discount.

This is probably a bit complex to provide a solution here - unless someone has some code they’d be able to share already. Otherwise, Treepl Services will be able to implement this for you (submitting a job via your Portal) if you’re not sure how to code this.

1 Like

Thanks @Adam.Wilson for the info! I was afraid it would be pretty complex and maybe outside my comfort zone to script out. I’ll see if there’s any available scripts out there and hopefully maybe someone from the forum can share their code. Otherwise, like you said I may need to reach out to Treepl Services and see if if they can get it done. I always appreciate the help!