Skip to content

Fix: add multiple domains to cart via sequential requests - #214

Open
hvidalnegreiros-godaddy wants to merge 1 commit into
masterfrom
fix/multi-domain-cart-add
Open

hvidalnegreiros-godaddy wants to merge 1 commit into
masterfrom
fix/multi-domain-cart-add

Conversation

@hvidalnegreiros-godaddy

Copy link
Copy Markdown
Collaborator

Summary

GoDaddy's Cart API only persists one domain-type cart item per POST — a single request containing multiple items (even with distinct domain values) results in cartCount staying at 1. This meant selecting multiple domains in the Advanced Domain Search widget and clicking "Continue to Cart" only ever added the first one.

  • Upgrades domain-search to v5.0.2, which fixes this upstream by sending one sequential POST per selected domain (reusing the session cookie established by the first call) instead of a single multi-item POST.
  • Swaps in the updated UMD bundle (assets/js/domain-search.min.js) and bumps plugin version to 3.0.2.
  • On the first failed request in the sequence, the widget stops immediately, shows the error, and does not navigate to checkout.

Closes #209.

Test plan

  • Added cypress/e2e/09-domain-search-cart.cy.js: asserts sequential single-item POSTs in selection order and navigation to the final nextStepUrl on success; asserts abort-on-first-failure shows an error and does not navigate.
  • Verified locally against a fresh wp-env WordPress install: new spec passes (2/2) and full Cypress suite passes with no regressions (57/57).

Upgrade domain-search to v5.0.2, which fixes the Cart API only
persisting the first domain when multiple domain items were sent in a
single request. The widget now POSTs one domain at a time, sequentially,
and navigates to the final nextStepUrl on success or shows an error
and stops on the first failure.

Adds e2e coverage for the multi-select add-to-cart flow and the
abort-on-failure path.
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.

Only the first selected domain reaches the cart when several are selected

1 participant