What are the Slack Archives?
Itβs a history of our time together in the Slack Community! Thereβs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonβt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Is there a good way to programmatically apply a discount to an order during checkout?
Is there a good way to programmatically apply a discount to an order during checkout?
Comments
-
Spryker has to types of discounts:
β’ Cart rules: the discount will be applied automatically to the products based on set rules;
β’ Voucher codes: the discount will be applied to the products based on set rules and when a voucher is added.
Seems like cart rules is exactly what you want.
Here's the documentation on how to create discounts: https://docs.spryker.com/docs/pbc/all/discount-management/manage-in-the-back-office/create-discounts.html#prerequisites0 -
yeah I'm looking at cart rules but I'm struggling to figure out how to apply them. We have loyalty cards (number only) that give you some discount, and the customer is not registered
0 -
maybe if I create something similar to this π€ https://docs.spryker.com/docs/pbc/all/discount-management/tutorials-and-howtos/howto-create-discounts-based-on-shipment.html#activate-a[β¦]nt-carrier
0 -
These plugins add more options to select in the discount configuration.
How does these loyalty cards work? Like voucher codes?
0 -
well kinda. If you have one you are entitled to some discount and the number is always the same
0 -
(same per user that is)
0 -
So it's a voucher code with unlimited uses?
0 -
yes
0 -
and hundreds of thousands of valid numbers
0 -
And how are you currently storing these loyalty codes?
It's sounding like you are going to have to create new decision rules
0 -
the codes are in a separate system
0 -
I can ask it if the code is valid
0 -
the codes are personal and I can also validate that it's with the correct person
0 -
all I need for Spryker is to say "ok this ruleset is now valid" after that
0 -
Yeah, exactly. You are going to need to create a new decision rule plugin.
the decision rule plugin implements the method
isSatisfiedBy($quoteTransfer, $itemTransfer, $clauseTransfer): bool
0 -
You just need to check how are you going to implement the form where the user will add the loyalty code
0 -
we have a custom frontend
0 -
so I suppose it comes from somewhere(tm) through the Glue API π
0 -
Maybe you can also think of implementing this loyalty code as a Payment option, like the spryker's Gift Codes.
In our project we've implemented a loyalty points program and it works almost exactly as gift codes.
0 -
I think the discount rule system sounds like the way to try at least first. Thanks!
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K π Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random