Skip to content

fix(ep-commerce): 0.4.0 leftovers — bundle quantity, PDP stock, promo code lifecycle #449

Description

@field123

What is left after #448. Everything else from the review has been fixed on that branch.

+ on a bundle option can zero it instead of incrementing

On Playstation 5 Bundle 1, the t3 component has one option whose product does not resolve (it renders as "Select option", no name). Clicking + takes the quantity from 1 to 0, deselecting it.

An earlier version of this issue blamed maxQty: 0 in EPBundleOptionQuantityButton.tsx:85-88. That is wrong: with maxQty: 0 the button would be aria-disabled and the handler would return early, but the button is clickable. The Studio nodes carry only action, no previewState override, so the mechanism is not yet established — it needs reproducing before a fix.

Separately, t3 has min: 2 with a single option, so the component can never be satisfied and the bundle cannot be added to cart at all. Probably bad catalog data; worth confirming before treating it as code.

PDP auto-selects an out-of-stock variant

/product/0055772c-6829-47f1-b4d3-22812c34ed55 selects 75934490-… and appends it as ?variant=. Add to Cart then fails:

POST /api/ep/proxy/addCartItem 500
[Error: epAddCartItem: There is not enough stock to add Sandle to your cart]

Forcing an in-stock child (?variant=724b2791-…) works. The shopper gets a priced, apparently purchasable PDP whose only action 500s with no message. Needs a decision: prefer an in-stock variant, or surface the out-of-stock state in the buybox?

Removing a promotion does not detach the code

removeCartItem on a promotion_item returns 200, but EP recalculates and re-adds it because the code stays attached to the cart. #448 stopped rendering promotions as purchasable lines, so the row no longer appears — but a "remove this promotion" affordance still has nothing behind it.

The promo input forgets it was applied

EPPromoCodeInput holds its applied state in local useState, so any navigation loses the "TEST1" chip while the discount is still live on the cart. It should derive applied promotions from the cart instead.

Reproduced against the integration environment with promo code TEST1.

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