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:

