Only combine products with the same VAT rate in one order
Real catalog has 3 different VAT rates (5%, 8%, 10%) - the algorithm previously mixed products across rates freely within one combo. Each attempt now picks a random pivot product to fix that attempt's tax rate, then only combines within that same-rate subset. Pivot selection is weighted naturally by group size (uniform draw over all candidates), so larger rate groups are proportionally more likely to be tried first. Verified against the real catalog: all previously-working target amounts still succeed, every returned combo uses exactly one VAT rate. Co-Authored-By:Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017KPzWwuTEeX2vXGXvyGn4q
Showing
Please
register
or
sign in
to comment