For my record, I accessed the checkout page for the first time using an incognito window, ensuring no previous session or local storage interference. However, I noticed that the first shipping option was automatically selected, instead of the cheapest shipping option, which I expected.
This unexpected behavior is the reason I’m reporting the issue to you and your team.
And here is my delivery customization function
code:
function run() {
return {
operations: [
{
move: {
deliveryOptionHandle:
"65888ee8b6c7c5fe045f9b2e0e57eaf1-c3e090203786bc2e8bb3ca305acd7816",
index: 1,
},
},
{
move: {
deliveryOptionHandle:
"65888ee8b6c7c5fe045f9b2e0e57eaf1-6058796404e38ca1cabdcb4ec7f9ef8e",
index: 2,
},
},
{
move: {
deliveryOptionHandle:
"65888ee8b6c7c5fe045f9b2e0e57eaf1-0032a34caa898da7178d58bd34dfa31c",
index: 3,
},
},
],
};
}
with function input:
{
"cart": {
"attribute": null,
"cost": {
"subtotalAmount": {
"amount": "700.0",
"currencyCode": "VND"
}
},
"deliveryGroups": [
{
"deliveryAddress": {
"city": "",
"countryCode": "VN",
"provinceCode": null,
"zip": null
},
"deliveryOptions": [
{
"handle": "65888ee8b6c7c5fe045f9b2e0e57eaf1-80ec4a7496a2dd1c91ac653b79c996f6",
"title": "Free shipping",
"cost": {
"amount": "0.0"
}
},
{
"handle": "65888ee8b6c7c5fe045f9b2e0e57eaf1-0032a34caa898da7178d58bd34dfa31c",
"title": "Shipping option 1",
"cost": {
"amount": "10.0"
}
},
{
"handle": "65888ee8b6c7c5fe045f9b2e0e57eaf1-c3e090203786bc2e8bb3ca305acd7816",
"title": "Shipping option 2",
"cost": {
"amount": "12.0"
}
},
{
"handle": "65888ee8b6c7c5fe045f9b2e0e57eaf1-6058796404e38ca1cabdcb4ec7f9ef8e",
"title": "Shipping option 3",
"cost": {
"amount": "20.0"
}
}
]
}
]
}
}