Shopify Functions

Solved

Shopify Functions

philip_beauford
Shopify Partner
6 0 1

Hi,

I've successfully followed a few of the docs tutorials but am currently trying to write a delivery customization to update the standard delivery cost to $0 during checkout for specific customers and I'm not sure how to update the delivery cost using Shopify functions.

My graphQL query input is correct, so I have the cost amount value in my input response but if I try to simply grab the standard deliveryOption object and update the amount property of the cost property, it tells me the function has returned invalid JSON (in admin).

The docs use a return operation array that uses a HideOperation and theres also a RenameOperation & MoveOperation but none of those support changing the delivery cost, only the titles. Can anyone please let me know how to simply update the value of the delivery option cost using a Shopify function, any help is greatly appreciated.

Accepted Solution (1)

Nick_Wesselman
Shopify Staff
167 42 65

This is an accepted solution.

Hi @philip_beauford -- The delivery customization API does not support this currently. There is a shipping discount API in developer preview. Otherwise I'd recommend logging or upvoting a feature request here:
https://github.com/Shopify/function-examples/discussions/categories/feedback-delivery-customization-...

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

View solution in original post

Replies 2 (2)

sebastiandev
Shopify Partner
67 1 20

Hi @philip_beauford,

could you show me your current code? It will be helpful for verification and finding a solution.

Nick_Wesselman
Shopify Staff
167 42 65

This is an accepted solution.

Hi @philip_beauford -- The delivery customization API does not support this currently. There is a shipping discount API in developer preview. Otherwise I'd recommend logging or upvoting a feature request here:
https://github.com/Shopify/function-examples/discussions/categories/feedback-delivery-customization-...

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