Discussing Shopify Functions development, deployment, and usage in Shopify apps.
We offer local delivery to our customers but want to rename the option that appears on one-page checkout. I have implemented this tutorial (I have only removed the zip code filter) and it does rename the standard delivery option but not the local delivery one.
Here is my code:
export function run(input) {
const message = "May be delayed due to weather conditions";
let toRename = input.cart.deliveryGroups
.flatMap(group => group.deliveryOptions)
.map(option => ({
rename: {
deliveryOptionHandle: option.handle,
title: option.title ? `${option.title} - ${message}` : message
}
}));
return {
operations: toRename
};
};
Here is a screenshot of the checkout page:
Here is a screenshot of the function run details:
Hi Jamalali81,
From what you've shared this should work - but I've reached out to our product team to see if this is an intended limitation.
Liam | Developer Advocate @ 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 Shopify.dev or the Shopify Web Design and Development Blog
Thank you! Please keep me updated.
Hi Liam, looks like local delivery options cannot be renamed.
Take from this page. Is there a reason for this?
Hi again Jamalali - it does indeed look like this is not currently possible. I'll connect with our internal dev teams though to see why this is and to make a feature request to be able to programmatically adjust the name.
Liam | Developer Advocate @ 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 Shopify.dev or the Shopify Web Design and Development Blog