Skip to content

checkout preview fails with 'has no current price' for baskets with options #51

Closed

Description

@zom-2018

Problem

wolt checkout fails for any basket that has options:

basket cannot be used for checkout preview: basket item "<id>" option "<group>" value "<value>" has no current price

Cause

The basket response lists the chosen option values by id and count only; Wolt does not echo their price. BuildBasketUpsertItem requires a price for every option value and rejects the basket, so checkout preview is impossible whenever an option is selected, even though the catalog the CLI already loads contains those prices.

Fix

PR follows: fill missing option value prices from the catalog payloads checkoutpayload.Build already loads. A value with no price anywhere is still rejected, so no price is guessed.

Related

wolt cart add writes the line price as the item's base price, so paid option values are not reflected in the basket line price (subtotal in the preview excludes them). That is a separate question and not addressed here.

Activity

  1. zom-2018 commented on Oct 12, 2026

    @zom-2018
    Author

    Follow-up on the "Related" note: the line price saved by wolt cart add has to include the selected paid option values, otherwise the cart and the checkout preview disagree.

    Example (Make Your Own Pasta, base 12.00 EUR, chicken +4.50 EUR):

    before after (#53)
    saved line price / wolt cart subtotal 12.00 16.50
    wolt checkout item subtotal 12.00 16.50

    cart add stored only the dish's base price, so a basket with paid options under-reported what the dish costs, and the preview built from that line inherited the same number. #53 now saves base price + sum(option value price x count) for non-weighted lines (weighted lines keep their weight-based pricing). The checkout logic itself is unchanged: it already multiplies the saved line price by the count.

    The existing TestCartAddKeepsFallbackCountsConfiguredTotalAndNestedPrices asserted the old behaviour and now expects the line price to include the options (500 base + 2 x 100 = 700).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions