{% liquid
assign base_price = 700
assign fulfillment_surcharge = 0
for item in shopify_rate_check.items
if item.fulfillment_service == "printful" and item.requires_shipping
assign fulfillment_surcharge = 500
endif
endfor
assign total_price = base_price | plus: fulfillment_surcharge
%}
{
"rates": [
{
"service_name": {{ "Fulfillment-aware Shipping" | json }},
"service_code": "FULFILLMENT",
"currency": {{ shopify_rate_check.currency | json }},
"total_price": {{ total_price }},
"description": {{ "Adds $5.00 when Printful-fulfilled items are present" | json }}
}
]
}