@Luke i did what you say, but i met another problem, i just hide one shipping method in function, but the frontend page shows ‘Shipping not available
Your order cannot be shipped to the selected address. Review your address to ensure it’s correct and try again, or select a different address.‘
here is the detail of my function(input,output,logs) & shipping configuration at shopify admin dashboard:
Customer Context:
Shipping Address: United States, NY
Function Context:
- the part of rust code about how to call hide function:
- input:
{
"cart": {
"deliveryGroups": [
{
"id": "gid:\/\/shopify\/CartDeliveryGroup\/0",
"deliveryAddress": {
"countryCode": "US",
"provinceCode": "NY"
},
"deliveryOptions": [
{
"handle": "d7ac0988951ed0a4431d71a5c511f671-69723fff8c227e1a0225fd0632a536be",
"title": "Standard Shipping (3-7 Day)",
"code": "Standard Shipping (3-7 Day)"
},
{
"handle": "d7ac0988951ed0a4431d71a5c511f671-5e337d31cad8c5095325215cdec9a558",
"title": "Expedited 2-Day Shipping",
"code": "Expedited 2-Day Shipping"
}
]
}
],
"lines": [
{
"merchandise": {
"__typename": "ProductVariant",
"id": "gid:\/\/shopify\/ProductVariant\/50175777931554",
"sku": "TP201",
"metafield": {
"value": "{\"CN_GD\":87,\"US_NY\":10}"
}
},
"quantity": 11
}
]
},
"deliveryCustomization": {
"metafield": {
"value": "eyJjYXJ0X29iamVjdCI6MSwiY29uZGl0aW9uX29wZXJhdG9yIjoxLCJjb25kaXRpb25fdmFsdWUiOi0xLCJhY3Rpb25fdHlwZSI6MSwiYWN0aW9uX3RhcmdldF9vcGVyYXRvciI6MSwiYWN0aW9uX3RhcmdldF9wYXR0ZXJuIjoiRXhwZWRpdGVkIDItRGF5IFNoaXBwaW5nIn0="
}
}
}
- output:
{
"operations": [
{
"deliveryOptionHide": {
"deliveryOptionHandle": "d7ac0988951ed0a4431d71a5c511f671-5e337d31cad8c5095325215cdec9a558"
}
}
]
}
Shopify Admin Dashboard Context:
Now what i’m confirmed info:
- the product quantity i purchased is < my location quatity
- my function works fine
- i’ve looked into my rust code(print more debug log), it just hide the ‘Expedited 2-Day Shipping‘, didn’t change any other shipping method
What I expect:
it should display ‘Standard Shipping (3-7 Day) - Free‘ Shipping method at custmer checkout page, why it shows nothing ?