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

Cart Qualifier - "Multi-Select - Meets all conditions" with "Discounted Cart Subtotal (applied by scripts)" not working #96

Closed
binarymonkey84 opened this issue Mar 4, 2024 · 2 comments · Fixed by #105

Comments

@binarymonkey84
Copy link

I noticed what looks like a bug - as follows:

Steps to reproduce

  1. Create a new campaign type "Conditional Discount" which uses a Cart Qualifier of "Multi-Select - Meets all conditions".
  2. Add two conditions, each one being "Discounted Cart Subtotal (applied by scripts)". These conditions should restrict the discount to only apply between X and Y cart subtotal values (e.g. £60-89.99)
  3. Add discounted item selector, and specify a SKU - apply discount a maximum of 1 time and set to 100%

Config file to reproduce example:

{"version":"ShopifyScriptCreatorFile-V0.34.2","type":"line_item","campaigns":[{"name":"ConditionalDiscount","active":true,"label":"GWP Tier 1","id":11,"inputs":[":all",{"name":"none"},{"name":"AndSelector","inputs":[{"name":"PostCartAmountQualifier","inputs":[":greater_than_or_equal",60]},{"name":"PostCartAmountQualifier","inputs":[":less_than_or_equal",89.99]},{"name":"none"}]},{"name":"VariantSkuSelector","inputs":[":does",":match","[\"SBFCW200\"]"]},{"name":"PercentageDiscount","inputs":[100,"\"Free Gift when you spend £60-80.99\""]},1]}]}

image

Expected result

The discount should only be applied if the cart subtotal is within £60-89.99 after discounts are / would have been applied.

Observed behaviour

The discount is applied to the cart subtotal, rather than the cart subtotal after discounts have been applied by scripts.

E.g. The customer is only actually spending £49, but they still get the discounted item. They need to be spending £60-89.99.

image

Notes

This behaviour works fine when using "Discounted Cart Subtotal (applied by scripts)" cart qualifier, but not when using "Multi-Select - Meets all conditions" with "Discounted Cart Subtotal (applied by scripts)".

@jgodson
Copy link
Owner

jgodson commented Mar 5, 2024

Hey @binarymonkey84 👋🏻. Thank you for the bug report and the excellent issue write up!

I think the issue is that I account for one PostCartAmountQualifier (the Discounted cart subtotal that you are using there) so the second one (<= 89.99) will be the only one that's checked and the cart in your example meets that. I don't think it should be a huge change to make this work properly as I can change that to an array of qualifiers instead. I will see if I can get to this sometime!

@jgodson
Copy link
Owner

jgodson commented Apr 19, 2024

Sorry for the delay, but I finally got to this. It should be fixed in the most recent release (V0.34.3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants