I’m looking to change shipping costs in my Shopify store based on unique delivery dates that I keep as custom properties for each item in the cart. Here’s what I’m aiming for:
Each product in the cart has different delivery dates saved as line item properties.
The shipping fee should increase according to the number of unique delivery dates present.
If there is one delivery date, the shipping cost will be standard.
Two distinct delivery dates will result in double the shipping cost.
And this continues for additional delivery dates.
I explored Carrier Services but noticed that they operate with server-side caching and only recalculate under certain conditions, such as changes in variant IDs, weights, or addresses. Sadly, this doesn’t account for the line item properties where I store my delivery dates.
I also tried using Shopify Scripts but learned that they are limited to applying discounts on existing shipping rates and cannot create new shipping methods or raise original shipping costs.
Can anyone suggest a solution or alternative way to establish flexible shipping rate increases based on custom line item properties? Any help would be greatly appreciated.
Had the same issue last year with custom delivery requirements. Here’s what worked for me: I used checkout scripts plus a custom app that watches for cart changes through the Storefront API. When customers add items with different delivery dates, the app calculates the dates server-side and updates shipping options on the fly before checkout. You’ll need to set up separate shipping methods in Shopify admin for each scenario, then have your app turn them on/off based on your delivery date logic. It’s definitely more work than standard solutions, but you get full control over rates based on line item properties. The trick is catching the cart state before shipping calculation happens - don’t try to modify rates after the fact.
I had the same issue with custom shipping logic. A hybrid approach worked best for me. Build a middleware app between your storefront and Shopify’s shipping calculator. The app watches cart contents via Ajax calls, pulls delivery dates from line item properties, and shows shipping costs before checkout. Here’s how I did it: Set up multiple shipping zones in Shopify admin with different rate tiers. Your app then enables/disables zones based on how many unique delivery dates you have. This gets around the limits of Carrier Services and Scripts - you’re just controlling which shipping methods show up instead of changing rates on the fly. Customers see accurate costs upfront and checkout works normally with the right zone active.
this one’s tricky, but webhooks might work. Set up a webhook that fires when the cart updates - it’ll calculate unique dates and adjust shipping rates on the fly. can’t guarantee it’s perfect, but i’ve seen similar custom calculations work in shopify.