I'm using medusa v2 and I have a requirement like this. In the store front I need to show the promotions on a separate page. (Discount Promotions , 15% off Product A, 30% off Product B etc) as a list. Is it possible to get these information through an API. I see that the promotions are applied in the cart level. But initially when showing a list of product cart is not available and products are not added to cart
#getting promotions in the storefront
4 messages · Page 1 of 1 (latest)
Yo Yasiru
Medusa v2 applies discounts at cart level, so promos don’t show by default on product lists
But yeah, you can still fetch promo info using the /admin/discounts API
You’ll need to filter out active discounts and map them to products manually
Or store promo details in product metadata for easier access
This way you can build a separate page to list all current deals
Might need a custom endpoint if you want it clean and dynamic
Let me know if you want help setting that up
Hi guys i am trying to get the list of all the promotions to frontend when i was looking for that i found out thry are in sdk.admin for which we need admin credentials when i look into started templates for how they are doing it is like this const { promotions = [] } = cart but when i tried to do that it is an empty array until and unless we update the cart with some promocode it is not showing there so do we need to create the custom endpoint to get the list of promo which then we will render in storefront and update the cart?
@tranquil warren