GraphQL availableShippingRates & shipping discounts, how to handle?

dal-bello
Tourist
4 0 2

Here is a scenario, I have a custom storefront and a discount code that gives 100% discount on shipping rates when the shipping costs less than $10. 

This works fine on Shopify native checkout see screenshot below.

Screen Shot 2020-09-29 at 4.11.44 pm.png 

Now, when using GraphQL to get the same checkout object to render my custom checkout experience I can't find a way to figure out how to apply the discount only to a certain shippingRates when rendering the screen, see GraphQL responses for checkout.discountApplications and discount.availableShippingRates

0cce1c6a-6712-4e30-be36-56253f39fa17.png

378bcc24-1942-4a63-9254-1e51964c17e8.png

Any help would be awesome!

Replies 5 (5)
viktordebock
New Member
2 0 2

We're currently facing the same problem. We're creating a custom checkout using the storefront API, but we're facing some issues with visualising a discount being applied to a shipping rate.
With the script editor, you can create a discount for a specific shipping rate. When using the storefront API, there's no way to link a shipping discount created with the script editor to a shipping rate.

However discounts being applied to a line item are collected in a discountAllocations array for each line item. Isn't this possible to do this as well for the shipping rates?

BudaDigital_01
Shopify Expert
1 0 0

Any updates about this? I'm facing the same problem and i'm getting a lot of trouble with my customers regarding this.


dal-bello
Tourist
4 0 2

No word from Shopify 😞 I've never managed to fix the problem. 

bared-david
Tourist
7 0 4

Still waiting more than a year later. Shipping is a shambles.

 

We want to charge a flat express shipping rate regardless of where items are being fulfilled from (we have 5 locations). Shopify pushed me to use an app, or write a script. So I wrote a script to apply a discount by dividing the flat rate by the rate that was going to be charged to the user, subtracting that value from 1, then multiplying the charged rate by that number to get the discounted value (e.g. if the flat rate is $20, and the user gets charged $60 for shipping, it applies a discount of $40 to get back to $20).

 

It only works at checkout, no sign of discounts in the cart, customers remain confused until they get to checkout. Really frustrating.

dal-bello
Tourist
4 0 2

Because of the issues with missing data and other issues with the lack of support for custom store checkouts I had to move away from Shopify. It’s clearly not part of their business strategy and they have no plans to support that. So we moved to WooCommerce.
If you look at my other posts, they are all related to custom checkouts, and none of the issues I found were ever addressed.