#How to show discount price for product belonging to a Promotion, before being added to cart?

13 messages · Page 1 of 1 (latest)

narrow forge
#

Hello,

I was testing the PromotionsModule, since i want users to be able to define products to which they want to apply %OFF

The calculated_price is not showing the discounted price, when fetching from list and retrieve endpoints. I want to be able to show the discounted price, along with the original in the ProductCard and ProductDetail, so before adding to Cart.

When i add to cart, it correctly shows the calculated and original price, as part of the items response.

Upon diving into the source code, i see that the link definition for calculated_price, at the product_variant level, is referencing price_list.

My question then: How to be able to show the discounted price for products, before they are added to cart?

narrow forge
#

Have checked the docs regarding the pricing module and it is sligning with this findings, so maybe somebody can shed light on this ?

trim dagger
#

Hello Nicolas I had the same issue don't know if this was the right way but I created a link between the product and promotion using the defineLink function then was able to query the promotions that way.

queen kite
#

@narrow forge Did you implemented @trim dagger solution or did you figure out something else?

trim dagger
#

@queen kite No they fixed it in the recent update I think what version of Medusa are you on

#

Try version 2.10.1

narrow forge
#

Hey @queen kite havent tried his solution and haven't tested 20.10.1 update regarding this promotions but Will let You know

queen kite
#

@trim dagger I updated to v2.10.1 but my products calculated price is not including automatic promotion in it?

queen kite
toxic forum
#

This is my use case as well so commenting for reference. Not tried anything yet.

queen kite
#

@narrow forge Hi Nicholas, apologies for the direct ping. I am following up on how to display pricing with automatic promotions before an item is added to the cart. Could you please point me in the right direction when you have a moment?

narrow forge
#

Haven't tried with latest versión (and i thin i could have read some PR where this was mentioned, although not sure) havent had the time. Have You tried it in 2.10.1?

queen kite