[5.x]: Can discounts Match Customer check against a completely anonymous cart
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 240
- Forks
- 173
- Avg merge
- 5d 11h
- Merged PRs (30d)
- 8
Description
What happened?
Description
Current behaviour dictates that as soon as you create one rule in a customer condition on a discount this requires the cart must have a customer on it (even if they are a guest/non-credentialed user).
This works for the most part but does somewhat require that the email address for a cart is taken early in the process.
For example, somewhere this logic falls down is if a discount:
- has a coupon code
- has user group customer condition rule "where user is not in group
XYZ"
If the coupon code is entered earlier than the email then this fails, even though logic may suggest an anonymous customer who is yet to provide those details is not in that group.
Craft CMS version
5.x
Craft Commerce version
5.x
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the discount customer-condition evaluation for a cart where the coupon code is entered before the email address. Reproduce the user-group rule "where user is not in group XYZ" on an anonymous cart, then verify that the condition can be evaluated without requiring customer details first.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100