Feature #12033
openShipping analytics: date-wise and location-wise drill-down, ledger fixes, and checkout free-shipping rule
100%
Description
Shipping analytics tab (Admin → Ecommerce Analytics → Shipping)
Added a view selector: Normal, Date wise and Location wise.
Date wise: date → locations → orders. Location wise: location → dates → orders.
Clicking an order opens its Admin Order View page.
The innermost order table shows customer, location or date, items, amount, type, shipping, discount, paid, refunded, courier cost, net, status, shipments and tracking.
Layout now follows the Products page: one white card, search on the left, filters on the right, gray table headers.
Search works in all three views.
Dates now show in US format (MM/DD/YYYY).
The "Net shipping result" alert is commented out.
Fixed the ledger columns: Items, Shipping, date and location were blank because of field-name mismatches.
Backend: the order list now returns city, state and country for each order.
Subtasks
Related issues
Updated by Pavan Kumar Murala 1 day ago
- Status changed from In Progress to Resolved
- % Done changed from 0 to 100
- Estimated time changed from 3:00 h to 5:00 h
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.