Rename local delivery option in one-page checkout

Topic summary

A developer is attempting to rename the local delivery option in Shopify’s one-page checkout using delivery customizations. They followed Shopify’s tutorial and successfully renamed the standard delivery option, but the local delivery option remains unchanged.

Current Implementation:

  • Code iterates through delivery groups and options
  • Applies rename operation with custom message
  • Works for standard delivery but not local delivery

Suggested Solution:
Another user recommends adding a conditional check to specifically target the local delivery option by its handle. They suggest temporarily logging option handles to the console to identify the correct handle for local delivery.

Outstanding Questions:

  • The original poster asks for documentation links explaining how the handle-based targeting works
  • Seeks confirmation on whether their current approach is incorrect

The discussion remains open with the developer awaiting more detailed guidance on properly targeting and renaming the local delivery option specifically.

Summarized with AI on November 13. AI used: claude-sonnet-4-5-20250929.

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,

I believe you’ll need to modify your existing code to target the specific local delivery option, by applying a condition that checks if the current delivery option is indeed the local delivery option. You may need to target the local delivery option handle specifically - if you’re not sure of the handle, you can temporarily log the handles to the console to find out:

input.cart.deliveryGroups
.flatMap(group => group.deliveryOptions)
.forEach(option => console.log(option.handle));

Hope this helps!

``

Hi @Liam , thanks for replying.

In the function run details screenshot, the Output section shows the option.handle in the rename operation. Is that not the correct way to do it? Do you have a link to the docs with more details as to how this works? Thank you!