Hi,
I’ve done the following:
-
Created a “order routing location rule” function using the example from the template https://shopify.dev/docs/apps/fulfillment/order-routing-apps/location-rules/getting-started
-
I have a shop with a Canadian shipping fulfillment location (from the default dev shop test data), and added a Danish shipping fulfillment location
-
I have updated the order routing location rules - adding the new rule from the function as the first rule and deleted the default rules except “Use ranked locations” which is the second rule
The example works in basic scenario, i.e. the canadian fulfillment location is the fulfillment location on the order. BUT when I have an order with a product that is only available in Canada, and another product that is not available in Canada, only in Denmark, I would expect the order routing to split the order as Canada has rank 0 for one line item and the Canada location is not present in the ranking for the other product.
So the function output provides the expected ranking, but it does not seem to have an effect on the order - all lines are fulfilled at the Danish location.
The documentation from Shopify states “You can use location rules to rank the possible locations for a line item during checkout.” which is true c.f. the function result below, but it does not seem to have an actual effect on the order.
The function input:
{
"fulfillmentGroups": [
{
"handle": "1",
"inventoryLocationHandles": [
"92419883313",
"92419948849"
],
"deliveryAddress": {
"address1": "Gade 1",
"city": "København N"
}
},
{
"handle": "2",
"inventoryLocationHandles": [
"92419883313",
"92419916081"
],
"deliveryAddress": {
"address1": "Gade 1",
"city": "København N"
}
}
],
"locations": [
{
"handle": "92419883313",
"address": {
"countryCode": "DK"
}
},
{
"handle": "92419916081",
"address": {
"countryCode": "CA"
}
},
{
"handle": "92419948849",
"address": {
"countryCode": "DK"
}
}
]
}
The function output:
{
"operations": [
{
"rank": {
"fulfillmentGroupHandle": "1",
"rankings": [
{
"locationHandle": "92419883313",
"rank": 3
},
{
"locationHandle": "92419948849",
"rank": 3
}
]
}
},
{
"rank": {
"fulfillmentGroupHandle": "2",
"rankings": [
{
"locationHandle": "92419883313",
"rank": 1
},
{
"locationHandle": "92419916081",
"rank": 0
}
]
}
}
]
}