Discount Codes

BIABAJay
Shopify Partner
15 0 14

I currently use Shopify Scripts to implement all of my store's discounts. Some of the discounts don't apply if a discount_code is in the cart. I do this by checking input.cart.discount_code. 

 

Do I have access to discount codes in Shopify Functions?

Replies 4 (4)

Stephen2020
Shopify Partner
19 2 7

This is possible, but only via a diversion. You can save metafields at the discount codes and then query them in the input GraphQL. If you write the discount code in there, it is available in functions.

Sanket_Patel
Shopify Partner
19 0 2

@Nick_Wesselman  Could you kindly shed some light on this, please? 

I have also similar requirement in which, I am trying to provide different % discount based on Vendor name for same Discount Code. 

It is possible in Script Editor. I did not found documentation about it for Shopify Functions. 

 

Freelancer | Software Developer | Shopify Customization Guru | Shopify Public App Creator | sanket972528@gmail.com | https://sannket.com
Sanket_Patel
Shopify Partner
19 0 2

Is there plan to allow multiple discounts ?  See below screenshot,

Below does not returns any error, But.. only applied first object discount. 

Technically, discounts is array, it means we could submit multiple objects. 


Possible use case like my previous comment,
Vendor wise different % discount for SAME discount-code.   

Sanket_Patel_0-1682683659055.png

 

Sanket_Patel_2-1682684663926.png

 

Do you think, I might have missed any configuration in above ?

 

Freelancer | Software Developer | Shopify Customization Guru | Shopify Public App Creator | sanket972528@gmail.com | https://sannket.com
Stephen2020
Shopify Partner
19 2 7

Hi Sanket_Patel,

 

we've tried exactly the same thing, and we've got the same result: With Shopify Functions you cannot apply different discount percentages with one discount code.

 

Since this is an important standard case for us, we asked our Merchant Success Manager, who reached out to the developer team at Shopify.

 

Result: It is currently not possible in the setup, but is considered a possible future feature. She is still trying to find out if there is any more concrete information and will let us know.

 

My humble opinion: Currently, Shopify Functions cannot keep up with Shopify Scripts in terms of functionality. What is also missing from my point of view:

  • There is no possibility to perform a line_item.split. However, this is often needed if you only want to apply a discount to a limited number of items in the shopping cart.
  • There is no possibility to limit the number of a variant in the shopping basket.
  • There is no possibility to remove a line item from the shopping basket. We have a whole series of use cases for this in particular.

 

And something like the Launchpad is completely missing.

 

One can only hope that Shopify will still improve this.