1. Free-shipping rule (checkout, cart, backend)
The product page's "Free shipping" checkbox now means the product can get free standard shipping once the order reaches the company minimum. Unchecked products, such as big items, always pay shipping.
Nothing ships free on its own any more. Only checked products count toward the minimum.
This is in payment.service.js, shippingSplit.service.js, Checkout.tsx, cart.tsx and the help text in ShippingSection.tsx.
Existing products need the box ticked to qualify for free shipping.
Express shipping now shows its normal price crossed out when it is free, like Standard does.
2. Checkout currency
Checkout now always follows the delivery country's currency: India shows ₹, UK shows £, US shows $. Before, it switched only once. I also added more country-name aliases in CurrencyContext.tsx.
3. Shipping analytics tab (admin)
I added a view dropdown (Normal / Date wise / Location wise) with drill-downs: date → location → order, and location → date → order.
Each order opens its order page, and the innermost table shows full order details.
The layout now follows the Products page. Dates are in US format, and the "Net shipping result" alert is commented out.
I fixed ledger columns that showed blanks because of field-name mismatches, and the backend now returns city, state and country. This is in ShippingAnalyticsTab.tsx and courierFinance.service.js.
4. Emails and pushes
The cancellation, refund, return and order-status emails now show amounts in the customer's currency instead of a hardcoded "$".
The return refund email now breaks the refund into items, shipping refunded and free shipping taken back.
The item-cancelled email now has a shipping note.
Refund pushes now show the currency and "(includes … shipping)".
I also fixed a missing opening </div> in orderStatus.ejs.
5. Dashboard crash
The pending vendor approvals list crashed because the vendor address was an object. It now renders the address as text.
6. Cancellation test case
I ran your two-product cancel scenarios through the real refund functions. The results matched what you expected, and the 8 shipping unit test files pass.
Cancelling only the free product refunds $0 shipping. Cancelling everything refunds the charged shipping.