Skip to content

Multi-count basket lines are mispriced: Wolt basket total ignores count, checkout preview counts it twice #59

Closed

Description

@vsem-azamat

Summary

A basket built with wolt cart add --count N (N > 1) gets three different totals: the Wolt app, cart show, and checkout. The arithmetic suggests the line price semantics differ between the basket and the purchase plan, and the live smoke likely uses count = 1 only, so it doesn't catch this.

Reproduction

This is wolt-cli main at dbb1952, with the checkout fix from #58 applied so the preview runs. The venue is Tesco Hypermarket Nový Smíchov in Prague (6539247b9eecd6092fb9e117). I built a 17-line basket with wolt_cart_add, adding one line at a time. Lines with count > 1:

item count price stored on the basket line
cucumber 99b65bb1… 2 2750
olives 1dfd4b06… 2 6290
avocado 7136dde9… 2 3790
water f6ed3476… 3 1990
mozzarella 314108ba… 2 2490

All other lines have count 1. Potatoes are weighted: count 3, 900 g, price 1161.

Observed

  • Expected subtotal Σ count × unit price: 1,142.21 CZK.
  • telemetry.basket_total / basket total from Wolt: 949.21 CZK. The Wolt app shows the same 949.21 for this basket. That equals Σ price with counts ignored.
  • wolt checkout "Item subtotal" from Wolt: 1,568.01 CZK.
    • The difference 1,568.01 − 1,142.21 = 425.80 is exactly Σ (count² − count) × price over the multi-count lines.
    • Breakdown: 2·27.50 + 2·62.90 + 2·37.90 + 6·19.90 + 2·24.90 = 425.80.
    • So Wolt multiplies end_amount by count again. Build already sends end_amount = count × price.

What this suggests (not verified against the web app)

  1. Basket line price. Wolt's own total treats it as the line total: price × count, including options. cart add stores the unit price, per the comment in commands_cart.go ("Wolt stores the unit price of a basket line…"). The weighted line already stores a line total (1161 for 900 g), and that line adds up correctly.
  2. Purchase-plan end_amount. Wolt appears to treat it as a per-unit amount and multiplies it by count.

If both hold, cart add should store price × count for count-based lines, and checkout should send end_amount per unit. Weighted lines also need a check, because count 3 with end_amount 1161 would be multiplied too. Capturing what wolt.com sends when you press "+" on a line, and the purchase plan it posts, would settle the question. I can open a PR once the expected contract is confirmed.

Impact

The Wolt app shows the wrong total for baskets built by wolt-cli, and agents comparing services read wrong totals from cart show / checkout. It's unclear what the order would actually be charged.

Activity

  1. mekedron commented on Oct 17, 2026

    @mekedron
    Owner

    Thank you for this report, @vsem-azamat. The arithmetic you worked out pointed straight at the bug and made it quick to pin down.

    We captured what wolt.com itself sends to settle the open question. Your first point was right: a basket line's price is the whole-line total, count x (unit price + paid options). The second turned out the other way round. The checkout end_amount is also the whole-line total, and Wolt does not multiply it by count. base_price is one unit without options. The checkout preview only looked like it counted twice because the CLI sent count x price while the basket held a unit price.

    The fix is in #60 and ships in v2.5.2. cart add stores whole-line prices, count changes rescale them, and checkout sends them the way the Wolt app does. The daily live smoke now adds two units and checks the line, Wolt's own basket total and the checkout item subtotal against each other.

    One note for the basket you built: its lines still hold unit prices, so rebuild it after upgrading.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions