Repository navigation
fix(checkout): recover option value prices from the catalog - #53
Merged
mekedron merged 4 commits intoOct 12, 2026
Merged
Conversation
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.
Wolt's basket response lists chosen option values by id and count only, so BuildBasketUpsertItem rejected any basket with options as having no current price, and checkout preview failed. Fill missing value prices from the catalog payloads Build already loads; values with no known price are still rejected.
The basket line price was saved as the dish's base price only, so a basket with paid option values (for example a +4.50 protein) showed and previewed the base price while the dish costs more. Save base price plus the selected option values, which also keeps cart and checkout preview consistent. Weighted lines keep their weight-based pricing.
zom-2018
pushed a commit
to zom-2018/wolt-cli
that referenced
this pull request
Oct 12, 2026
# Conflicts: # internal/cli/cart_helpers_test.go
…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.
Owner
|
@zom-2018 thank you for #52 and #53, and for the clear issues (#50, #51) with live repro steps. Both fixes are verified against the live API and shipped in v2.4.2. A couple of notes:
If you spot anything else, issues and PRs are very welcome. I'll be happy to merge them. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #51
What
Recover missing option value prices from the catalog payloads
checkoutpayload.Buildalready loads, beforeBuildBasketUpsertItemvalidates the line. Values with no known price anywhere are still rejected, so nothing is guessed.Why
The basket response lists chosen option values by
idandcountonly, so every basket with options failed checkout preview with "has no current price".Test
TestBuildRecoversOptionValuePricesFromCatalog(fails before, passes after) andTestBuildStillRejectsOptionValueWithoutAnyPrice.go build ./...,golangci-lint run,go test ./...,go test -race ./internal/service/checkoutpayload.wolt checkouton a basket with options now returns a preview instead of the error.Also
cart addsaved the line price as the dish base price only, so paid option values were missing from the cart and from the preview subtotal. The line price is now base price + selected option values (weighted lines unchanged), sowolt cartandwolt checkoutagree.TestCartAddKeepsFallbackCountsConfiguredTotalAndNestedPricesis updated to expect this (500 + 2 x 100 = 700) andTestBasketOptionsTotalSumsPaidValuesis new.