Open chladog opened 3 years ago
This would also help with missing list prices for member groups
I've added the feature label and priority, but this sounds like a good use case for a custom plugin, outside of vendure/core?
The flexible nature of Vendure promotions might make it hard to resolve promoted prices for all different kind of custom promotions. I would say if this is in core, then it should be able to handle that. If it's fine to just show promoted prices for the promotions you use in your own project, it can probably be a custom plugin?
Is your feature request related to a problem? Please describe. When ProductVariant is eligible to some currently active promotion it's not possible to get "would be" price. In my current implementation I'm solving this by mirroring the promotions logic in UI app.
Here are examples of our promotions for reference: Bulk pricing:
X+Y promotion
Discounts:
It's hard to sync, maintain and combine such all promotions together to list the correct would be price. And basically impossible to also consider current cart contents - e.g. You have 4 of this productvariant, order 2 more of this productvariant to get "Y" price.
Describe the solution you'd like New function
getPromotedPrices
that would allow us to create a custom resolver for property e.g.: "promotionPrices". We should be able to pass conditions that should be taken into the calculation e.g. productVariant quantities or other order properties / contents. This function should also consider active order of the customer - e.g. if user has some content in cart that makes him eligible already the price should reflect that.e.g.
in return we would get a Map with priceId and calculated price per piece as if promotions apply.
examples: we could call this with some cart content if we want to hint the price for such quantity
and get
we could call this function with order.couponCodes to list prices that "would be" with some coupon active like so:
and get
it might be helpful to also provide a default calculator with "promotionPrices" property that would equal to:
which would calculate basic promoted price taking into consideration current promotions and productvariantid and would be used for basic listings.
Describe alternatives you've considered Mirroring promotion logic in frontend app.