1. Admin: Company Profile
Added Free Shipping by Country under Supported Shipping Countries.
Pick a country (US, India) to see only that country's shipping types.
Each country has Standard and Express, and you can + Add shipping type (for example priority).
Each type has Offered on/off, display name, description and the free-shipping amount.
The pop-up has the same details as the Ecommerce cards: margin, fixed markup, safety buffer days, minimum rate, maximum rate and fallback rate.
Standard and Express use store-wide pricing until a country gets its own pricing.
Amounts use the country's own currency (India in ₹).
Everything is read-only until the page's Edit button is clicked.
Configuring a new country also adds it to the supported countries.
2. Backend
New saved data: countryFreeShipping on the company.
POST APIs to add or update a country, load US/AU defaults, and remove a country's rules.
The server decides free shipping and checks the minimum per shipping type, per country.
Once any country has rules, a country without a rule gets no free shipping.
Amounts in the country's currency are converted with the customer's exchange rate.
A split order is priced for each shipping type, so every type can be chosen.
An added type with no fallback rate uses the carrier service's base cost, so it can't come out free by mistake.
The server saves the shipping type name on the order, not the browser's text.
Fixed the shop settings endpoint, which sent the country rules as database internals.
3. Storefront cart and checkout
Cart bar and note follow the header country, and the bar hides where the country has no free shipping.
Checkout lists exactly the country's types, with the names from your list, in admin order.
The first type is selected automatically, and each option shows its description and "Free on orders …+".
A split order shows the chosen type divided into parts, with each product's own charge or FREE.
The order summary lists each product's shipping charge.
Excluded products show "Not eligible for free shipping".
Checkout switches to the delivery country's currency (India ₹, US $).
The browser's old saved settings copy is ignored after the fix.
4. Orders, emails and receipts
The order page, confirmation email, admin email and receipt PDF name the chosen shipping type.
The emails name the products in each shipment, with their charge or Free.
5. Checks
Backend tests: 49 passing.
I ran the real shipping calculation for your Bagara Rice and tee cart, and the numbers matched what checkout shows.
Typecheck: no new errors in the files I changed (the project already had 249 storefront errors).
6. Known issues and follow-ups
Warehouse state "fsad" is invalid, so FedEx falls back to fixed rates. Set a valid 2-letter state.
India amounts saved before the currency change read as rupees, so re-enter them if needed.
Splits caused by different warehouses, or by Standard-only mixed with Express-only items, show only the breakdown, with no type choice.
Splitting by cancellable versus non-cancellable products is not done.
No text or WhatsApp message listing shipping charges was found.
Restart the backend and hard-refresh the storefront after release.