Skip to content

feat(frenet): Quote one package per volume for products shipped in several boxes - #856

Open
vitorrgg wants to merge 1 commit into
mainfrom
feat/frenet-volumes
Open

vitorrgg wants to merge 1 commit into
mainfrom
feat/frenet-volumes

Conversation

@vitorrgg

@vitorrgg vitorrgg commented Oct 5, 2026

Copy link
Copy Markdown
Member

Split air conditioners ship in 2–3 boxes (indoor and outdoor units). The Frenet quote sent one package per cart item with the product weight and dimensions, so prices didn't match the Frenet panel (Bom Ar Condicionado, store 401214).

How

  • Boxes stored on the product hidden metafield shipping/volumes, JSON with weight (kg) and [length, width, height] (cm): [{"kg":9.5,"cm":[90,30,25]},{"kg":23,"cm":[80,60,35]}].
  • Calculate shipping items don't carry metafields, so the app fetches the cart products once per quote (parallel, one request per distinct product; on error it falls back to the product data).
  • One ShippingItemArray entry per volume, times the item quantity. Products without the metafield: unchanged.
  • Boxes are never summed into one package (distorts cubic weight).

Chosen over modelling each box as a product and the appliance as a kit: that would create hundreds of box products with their own price and stock, unknown to the ERP (Olist/Tiny) that also integrates marketplaces.

Tests

node --test packages/apps/frenet/tests-unit/ (parser and package builder). Not yet compared against the Frenet panel: waiting for the store's box measures.

🤖 Generated with Claude Code

…veral boxes

Split air conditioners ship in two or three boxes (indoor and outdoor units),
but the quote sent one package per cart item with the product weight and
dimensions, so Frenet prices didn't match the carrier panel.

Products may now list their boxes on the hidden metafield `shipping/volumes`
(JSON, kg and cm). The app fetches the cart products once per quote (in
parallel, falling back to the product data on error) and sends one package
per volume times the item quantity. Products without volumes keep the
previous behavior.

Shipping items builder and volumes parser moved to `volumes.mjs`, covered by
unit tests (`node --test tests-unit/`).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant