Skip to content

Fix itemsAdded to skip giftItems when creating the order items.#84

Draft
nicholas-maestrello wants to merge 3 commits intomasterfrom
B2BTEAM-3154
Draft

Fix itemsAdded to skip giftItems when creating the order items.#84
nicholas-maestrello wants to merge 3 commits intomasterfrom
B2BTEAM-3154

Conversation

@nicholas-maestrello
Copy link
Contributor

@nicholas-maestrello nicholas-maestrello commented Feb 19, 2026

What problem is this solving?

The useQuote mutation was failing with CHK0023 "Cantidad de item inválida" when trying to add items to cart. Gift items were being included in the orderItems array sent to the price update API, but they shouldn't have price/quantity values set manually since they're automatically managed by promotions.
Also Add support for unitMultiplier on type QuoteItem and QuoteItemInput.

How to test it?

  1. Create a quote that includes gift items from promotions
  2. Use the quote via useQuote mutation
  3. Verify items are added to cart without errors

[Workspace](Link goes here!)

Screenshots or example usage:

Before:

{"orderItems":[{"index":8},{"index":9}]}  // ❌ Gift items with undefined price/quantity

After:

// Gift items are filtered out from orderItems array ✅
Screen.Recording.2026-02-20.at.15.43.16.mov
Screen.Recording.2026-02-20.at.16.55.29.mov
Screen.Recording.2026-02-20.at.16.58.04.mov
Screen.Recording.2026-02-20.at.17.03.06.mov

Describe alternatives you've considered, if any.

Could have set price/quantity to 0 for gifts, but filtering them out is cleaner since gift prices are controlled by promotions.

Related to / Depends on

Fixes the root cause identified in useQuote error logs (CHK0023).

@nicholas-maestrello nicholas-maestrello self-assigned this Feb 19, 2026
@vtex-io-ci-cd
Copy link

vtex-io-ci-cd bot commented Feb 19, 2026

Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖

Please select which version do you want to release:

  • Patch (backwards-compatible bug fixes)

  • Minor (backwards-compatible functionality)

  • Major (incompatible API changes)

And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.

  • No thanks, I would rather do it manually 😞

@vtex-io-docs-bot
Copy link

vtex-io-docs-bot bot commented Feb 19, 2026

Beep boop 🤖

I noticed you didn't make any changes at the docs/ folder

  • There's nothing new to document 🤔
  • I'll do it later 😞

In order to keep track, I'll create an issue if you decide now is not a good time

  • I just updated 🎉🎉

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.

1 participant