feat(vue-starter-template): checkout flow - #2700
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
🟡 Changes recommended
The checkout registration flow still hardcodes guest: true (so “Create customer account” remains broken) and InputField.vue contains malformed <span> markup that will break template parsing.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR targets the Shopware Frontends monorepo by improving the vue-starter-template checkout registration UX (validation, notifications, and a loading button label) and aligning useUser().register() behavior with other auth flows by refreshing the cart after registration.
Changes:
- Update
useUser().register()to refresh the cart after refreshing the session context, and adjust unit tests + changeset accordingly. - Refactor the checkout guest-registration step to validate email/billing address separately, improve error handling, and add a guest-registration loading label/state.
- Improve form-field accessibility by wiring input errors via
aria-invalid/aria-describedby, and surface notifications in the checkout layout.
File summaries
| File | Description |
|---|---|
| templates/vue-starter-template/i18n/pl-PL/checkout.json | Renames/introduces guest registration button/label translations. |
| templates/vue-starter-template/i18n/en-GB/checkout.json | Renames/introduces guest registration button/label translations. |
| templates/vue-starter-template/i18n/de-DE/checkout.json | Renames/introduces guest registration button/label translations. |
| templates/vue-starter-template/app/pages/checkout/index.vue | Refactors guest registration + adds focus/error handling and button loading state; adds place-order error handling hooks. |
| templates/vue-starter-template/app/layouts/checkout.vue | Adds notifications rendering to the checkout layout. |
| templates/vue-starter-template/app/composables/useApiErrorsResolver.ts | Removes unused variable in API error handling. |
| templates/vue-starter-template/app/components/form/InputField.vue | Adds ARIA wiring for validation errors (but currently introduces malformed template markup). |
| templates/vue-starter-template/app/components/checkout/CustomerAddressChosen.vue | Avoids rendering country name when unavailable. |
| packages/composables/src/useUser/useUser.ts | Refreshes cart after registration (currently not awaited). |
| packages/composables/src/useUser/useUser.test.ts | Updates tests to assert session/cart refresh calls after register. |
| .changeset/lucky-carrots-refresh.md | Adds changeset documenting the cart refresh behavior change in @shopware/composables. |
Review details
Suppressed comments (1)
templates/vue-starter-template/app/pages/checkout/index.vue:124
- This registration payload still hardcodes
guest: true, so even when the shopper chooses “Create customer account” and enters a password, the request will create a guest customer and discard the password (the original bug from #2699). This also means password validation/account-mode switching can't be enforced here.
email: customerBaseInfo.value.email,
password: customerBaseInfo.value.password,
guest: true,
billingAddress: {
- Files reviewed: 11/11 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Patryk Tomczyk (patzick)
left a comment
There was a problem hiding this comment.
Changes requested. CI checks reported by GitHub are passing; I did not run local checks.
Co-authored-by: Cursor <cursoragent@cursor.com>
…ware/frontends into fix/checkot-place-order-fix
There was a problem hiding this comment.
Stale comment
Security review
No medium, high, or critical vulnerabilities in this update.
Reviewed the checkout registration/place-order paths,
useUser().register()cart refresh, API error → notification rendering, andInputFielderror markup. Attacker-controlled form and API error strings are interpolated with Vue text bindings ({{ }}); notifications have nov-html.refreshCart()after registration uses the current session context. No new dependencies or secret leakage.There were no prior automation security-finding threads to re-validate. The hardcoded
guest: truepayload is a functional gap already tracked on this PR, not an authz bypass.Sent by Cursor Automation: Review pull requests for exploitable security issues and flag only validated findings before merge
There was a problem hiding this comment.
Security review
No medium, high, or critical vulnerabilities in this update.
Re-reviewed after feat: changes after CR (2b737a57). Prior automation run had no finding threads. Traced checkout register/place-order, useUser().register() cart refresh, API error → notification rendering, and InputField errors. Form and API error strings use Vue text bindings ({{ }}); notifications have no v-html. refreshCart() after registration stays on the current session. guest: !createAccount.value is the intended account-creation path, not an authz bypass. No new dependencies or secret leakage.
Sent by Cursor Automation: Review pull requests for exploitable security issues and flag only validated findings before merge
Patryk Tomczyk (patzick)
left a comment
There was a problem hiding this comment.
Rechecked current head 2b737a5. The previous registration blocker is fixed: checkout now sends guest: !createAccount.value and validates the password only in account mode. I am not carrying forward the InputField tag-formatting note; CI accepts it and it is valid tag-closing whitespace. GitHub CI checks are passing; no local checks run.


closes #2699
This pull request improves the registration and checkout experience by ensuring the cart is refreshed after user registration, aligning it with login and logout behaviors. It also enhances accessibility and error handling in the checkout flow, and updates button labeling for better user feedback during guest registration. Below are the most important changes:
Cart Refresh and Registration Logic:
useUser().register()method now callsrefreshCart()after updating the session context, ensuring cart totals reflect the correct tax rates, shipping surcharges, and customer-group prices immediately after registration. [1] [2]refreshSessionContextandrefreshCartare called after registration.Checkout Flow and Error Handling:
Accessibility Improvements:
InputField.vuecomponent now associates error messages with inputs usingaria-describedbyandaria-invalid, improving screen reader support for form validation errors. [1] [2]UI and Notification Enhancements:
LayoutNotificationscomponent to display notifications to users.Minor Fixes:
CustomerAddressChosen.vuecomponent ensures the country name is only displayed if available.useApiErrorsResolver.tsremoves an unused variable.