Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose the appropriate associate Promotion parameters for Coupon actions, conditions #1787

Closed
tianyingchun opened this issue Sep 16, 2022 · 0 comments

Comments

@tianyingchun
Copy link
Contributor

tianyingchun commented Sep 16, 2022

Is your feature request related to a problem? Please describe.

Consider this Scenario

  1. i have productA, productB both assign to facet 1USD

  2. create promotion without coupon code, setup action with facet 1USD to give fixed amount discount

  3. while add item to cart it will automatically appliy this promotion

  4. i want to implement discount logics like :
    we have 2 order line, first one(productA) used1 USD discount, forsecond orderline (productB) i don't want to apply the same discount
    Describe the solution you'd like

  5. for PromotionItemAction we need to know what Promotion we are dealing with, so we can check to see if that promotion has already been applied to any other order lines.

  6. for any other order lines via await orderService.findOneByOrderLineId(ctx, orderLine.id) to fetch.

  7. to check orderLine.discounts, orderItem.discounts

  8. async execute(ctx, orderItem, orderLine, args) {.... it need to expose associatePromotion to us is fine.

 new PromotionItemAction ({
 `async execute(ctx, orderItem, orderLine, promotion, order,  args) {....` it need to expose `associate Promotion`  and current actived `Order` to us
})

Describe alternatives you've considered

Additional context
vendure@ 1.7.1

@michaelbromley michaelbromley moved this to 🤔 Under consideration in Vendure OS Roadmap Sep 16, 2022
@michaelbromley michaelbromley moved this from 🤔 Under consideration to 🏗 In progress in Vendure OS Roadmap Oct 24, 2022
@michaelbromley michaelbromley added this to the v1.8 milestone Oct 24, 2022
@michaelbromley michaelbromley moved this from 🏗 In progress to 🔖 Ready in Vendure OS Roadmap Oct 24, 2022
@michaelbromley michaelbromley moved this from 🔖 Ready to ✅ Done in Vendure OS Roadmap Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

2 participants