Skip to content

fix(cart): send item-level option group ids in basket options - #52

Merged
mekedron merged 1 commit into
mekedron:mainfrom
zom-2018:fix/basket-option-group-id
Oct 12, 2026
Merged

mekedron merged 1 commit into
mekedron:mainfrom
zom-2018:fix/basket-option-group-id

Conversation

@zom-2018

Copy link
Copy Markdown

Fixes #50

What

When a dish's option group has both an item-level id and a library option_id, send the item-level id in the basket (the library id is kept as option_id). --option keeps accepting either id or the group name.

Why

The basket API accepts library ids, but the Wolt app only recognises item-level ids and shows the default choices instead of the selection.

Test

  • New TestBuildBasketOptionsUsesItemLevelOptionGroupID (fails before, passes after; covers selection by item-level id, library id and name).
  • go build ./..., golangci-lint run, go test ./..., go test -race on touched packages.
  • Manually verified on a real basket: the Wolt app now shows the chosen penne / chicken / tomato / no Parmesan instead of the defaults.

Wolt keys a dish's options by an item-level "id" and references the shared
option-library group through "option_id". buildItemPayloadFromAssortment
replaced the item-level group with the library group, so the basket was
written with library ids. The basket API accepts that, but the Wolt app only
recognises item-level ids and silently shows the default choices instead.

Rewrite the resolved group to carry the item-level id (keeping the library id
as option_id) and let --option accept either id.
zom-2018 pushed a commit to zom-2018/wolt-cli that referenced this pull request Oct 12, 2026
mekedron added a commit to zom-2018/wolt-cli that referenced this pull request Oct 12, 2026
…ion-value-prices

Both branches add a test to internal/cli/cart_helpers_test.go at the same
spot; the resolution keeps TestBuildBasketOptionsUsesItemLevelOptionGroupID
from mekedron#52 and TestBasketOptionsTotalSumsPaidValues from mekedron#53. With this merge
mekedron#53 applies cleanly on main once mekedron#52 is merged.
@mekedron
mekedron merged commit aa94c07 into mekedron:main Oct 12, 2026
3 checks passed
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.

cart add --option writes library option ids; Wolt app shows default choices

3 participants