Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: Shopify Functions Discounts removed when a custom sale is added to the POS cart

Shopify Functions Discounts removed when a custom sale is added to the POS cart

tobebuilds
Shopify Partner
557 42 151

Hi there,

 

I'm reaching out because I've come across an issue with my app that may affect others using the Discounts Functions API with POS Pro. I'd love to know if anyone else has experienced this, and if there might be a bigger problem that needs addressing.

 

When a custom sale is added to a POS cart, it seems to automatically remove any automatic discounts calculated through the Shopify Functions API, unlike Shopify's built-in automatic discounts which remain applied.

 

tobebuilds_0-1716905053857.png

 

 

Steps to Reproduce:

  1. Add a product to the POS cart.
  2. Apply an automatic discount using an app that utilizes the Shopify Functions API.
  3. Add a custom sale item to the cart.
  4. Notice the previously applied discount is removed.

This behavior points to a possible integration issue between Shopify POS and Shopify Functions.

 

What I've Done:

  • Confirmed through testing that my app calculates discounts correctly. I looked at the Shopify Functions logs, and saw my discount app's runs were successful, and did not crash with an error.

 

Is anyone else facing this issue?

 

Thank you for your time and help,

Tobe

Founder, Regios Discounts app (4.8 stars, 83 reviews, Built for Shopify)
- Custom discounts made simple
- "Just about any discount you'll ever need"
- Built by an ex-Google software engineer
- Often imitated, never duplicated
Replies 6 (6)

Dobby1
Tourist
5 0 3

Same Problem here.

 

tobebuilds
Shopify Partner
557 42 151

Update: The same issue applies when a custom item is added to a draft order, and the user tries to use "Apply all eligible automatic discounts."

If a "CustomProduct" is in the cart, the discounts calculated by Shopify Functions are completely ignored.

 

I've attached a screenshot of the output from a function run on a draft order where a "CustomProduct" was in the cart. As you can see, the output is well-formed and contains discounts, but none were applied to the order:

 

tobebuilds_0-1718114650898.png

 

Founder, Regios Discounts app (4.8 stars, 83 reviews, Built for Shopify)
- Custom discounts made simple
- "Just about any discount you'll ever need"
- Built by an ex-Google software engineer
- Often imitated, never duplicated

hikamedesigns
Visitor
1 0 3

We're also having this problem. 90% of our orders are custom items so this problem makes for a fair amount of unnecessary work. Hoping Shopify can find a solution! 

deanstokes
Visitor
1 0 4

Did this ever get resolved or is there a known workaround? We're facing the same issue.

SomeUsernameHe
Shopify Partner
519 58 113

I am running into this problem. I think B2B wholesale club used a POS button to apply discounts to custom items. I will try that the next few days and let you know. 

Have I helped? Consider putting coffee in my mouth!
Buy Me a Coffee

Dobby1
Tourist
5 0 3

The issue also occurs without a custom product. As soon as you save an order as draft and reactivate it, the discounts will not be calculated.
This is a huge pain, because you have to “rebuild” the entire order from scratch.
Please fix