Bug #12038
openIn checkout page , from split rates api gives only a single package shipping charges not the sum of the all packages amount
0%
Description
Question 1 (Individual Shipping & Multi-Box Sum):
Explains why live FedEx quotes do sum the 3 boxes, but offline fallback mistakenly charges a flat rate once instead of multiplying by packages.length ($7.99 vs $23.97).
Provides the blueprint to preserve all $N$ package dimensions (shipment.packages array) instead of truncating to packages0.
Question 2 (Admin Allowed Methods & Static Restrictions):
Explains how the system dynamically reads product/category configs from MongoDB, but is constrained by static string comparisons and completely bypassed in multi-warehouse orders.
Extends support for custom profiles (local_pickup_only, freight, etc.).
Question 3 (Mixed Cart standard_only + express_only Reliability):
Resolves the 2D Split Flaw so that orders split across both multiple warehouses and multiple transit speeds without downgrading live plants to Ground.
Replaces the greedy air-shipping bug by defaulting flexible items ("all") into Ground packages, protecting customers from inflated $100+ air freight fees.
Bonus (International Unit Harmonization):
Implements harmonizePackageUnits() in fedex.adapter.js to ensure pure Metric (KG + CM) or pure Imperial (LB + IN), preventing FedEx 400 Bad Request and 16x dimensional weight errors.
2. Real-Time Integration Test Cases Provided
Scenario Real-World Context What is Tested
Scenario 1 Multi-Piece (3 Planters) 3 individual boxes (shipsIndividually: true) from 1 warehouse. Validates that FedEx MPS calculates the consolidated rate and all 3 box dimensions are preserved in the response.
Scenario 2 Single-Warehouse Mixed Cart 1 Orchid (express_only) + 1 Soil (standard_only) + 1 Trowel (all). Validates that 2 shipments are created and the trowel is bundled into Standard Ground.
Scenario 3 The 2D Split (Multi-Warehouse) Warehouse A ships Bonsai (express_only); Warehouse B ships Soil (standard_only). Validates that Warehouse A ships via FedEx 2Day (plant lives) and Warehouse B ships via FedEx Ground.
Scenario 4 Carrier Outage / Fallback FedEx API down. Cart has 2 individual boxes. Validates fallback calculates $7.99 $\times$ 2 = $15.98 (not flat $7.99).
Scenario 5 International India $\leftrightarrow$ USA Indian export hub shipping to USA. Validates weights convert to KG AND dimensions convert to CM.

Files
Subtasks
Related issues