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.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Can I have two or more Shopify functions/extensions in an app for stackable discounts

Can I have two or more Shopify functions/extensions in an app for stackable discounts

fwallace
Shopify Partner
45 1 4

Issue:

 

I have working Shopify function and app installed on my development store for testing. During testing I find that the app works as intended, BUT ...

 

It will not "stack" discounts in particular BOGO discounts. So I have created in the Shopify Web Admin UI a BOGO discount:

 

discount_example.png

 

And it only "works" when I add two or more of the product that is NOT being discounted by the Shopify Function.

 

Is there a way to add another function that will also add "free" products if the quantity of products in a collection is 2 ?

 

In other words, if I add the "bogo" functionality to another Shopify function but share the same app name, will things just "work" ?

 

The desired behavior is that the one product gets the membership discount and if the cart has that and any other product in the same product collection a free product is added of the second product. This is now possible and in production with Shopify Scripts and an automatic discount in my live store. But I want a Shopify Functions solution.

 

And yes, the function has:

 

discountApplicationStrategy: DiscountApplicationStrategy.All,

 

api_version = "2024-01"

 

Please Advise.

 

Thanks.

Replies 2 (2)

Nick_Wesselman
Shopify Staff
171 43 73

Functions follow the same stacking/combination rules as other discounts. Have you reviewed allowed combination rules?
https://help.shopify.com/en/manual/discounts/combining-discounts/discount-combinations

If your combination is not possible out of the box, you might look at the Discounts Allocator API:
https://shopify.dev/docs/apps/selling-strategies/discounts/discount-function-examples/discounts-allo...

 

Nick Wesselman | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

fwallace
Shopify Partner
45 1 4

Nick -- don't see Discounts Allocator working, for the following reasons:

 

1. Only available on a Developer Preview store and thus not able to be installed on my live store for production.

2. Sets the max discounts, I want to have a BOGO function combine with the product discount for members only.

 

Looking to see if I can create an order/cart based discount to determine X number of items tagged or belonging to collection in cart, add zero dollar extra of lowest cost item as is possible with Script Editor today.