Skip to content

Orders 7764 render create return page with context#2673

Merged
bc-vivekaggarwal merged 8 commits into
feature/PROJECT-7525-new-returns-flowfrom
ORDERS-7764-render-create-return-page-with-context
Jun 11, 2026
Merged

Orders 7764 render create return page with context#2673
bc-vivekaggarwal merged 8 commits into
feature/PROJECT-7525-new-returns-flowfrom
ORDERS-7764-render-create-return-page-with-context

Conversation

@bc-vivekaggarwal

@bc-vivekaggarwal bc-vivekaggarwal commented Jun 4, 2026

Copy link
Copy Markdown

What?

Massive refactoring for new return flow to use updated stencil page context(order details, reasons and resolutions) and use the new /create-return route

Requirements

  • CHANGELOG.md entry added (required for code changes only)

Tickets / Documentation

Jira: ORDERS-7764

Screenshots (if appropriate)

All pages load fine:

###Orders listing page:
image

###Order details page:
image

###Add returns page:

When both flags(legacy returns_enabled and new returns_v2_enabled) off:

Orders list and Order details page don't show returns items and new_return route redirects to orders list page:
image
image

Existing add Return page (when only legacy returns_enabled):

image

Add return page when only new flag returns_v2_enabled enabled:

Redirects to orders list page. Currently BC app doesn't support redirection when legacy returns is disabled. We need to fix this as part of ORDERS-7825

Add Return page with new content(when returns_v2_enabled or both enabled):

image

New Design after consultation with JW and JH:
image


Note

Medium Risk
Changes which account routes load which return UI and how v2 is reached relative to feature flags; submission is not wired yet, but mis-routing could affect shoppers on the wrong template.

Overview
Moves the returns v2 UI off account/add-return onto a dedicated create-return route and page type, wired to stencil context (order, per-line returnableQuantity/price, and shared reasons/resolutions).

Routing & JS: app.js loads create-return.js for create_return and routes account_new_return back to the generic account bundle. add-return-new.js is removed in favor of CreateReturn, which validates submit from select controls (qty/resolution/reason), drops the quantity stepper, and exposes buildReturnInput() for the upcoming Storefront GQL submit (still a TODO).

Templates: add-return-new.html is deleted; add-return.html no longer branches on returns_v2_enabled and only renders the legacy POST return form (with small a11y/table copy tweaks). create-return.html implements the new layout: column headers on large screens, qty dropdowns capped by returnableQuantity, and dynamic reason/resolution options.

Styles & copy: .newReturn styles move from addReturn into a new createReturn SCSS component (header buttons, column alignment, select widths). en.json adds/updates strings for the new return request UX.

Reviewed by Cursor Bugbot for commit 4ee19ec. Bugbot is set up for automated code reviews on this repo. Configure here.

@bc-vivekaggarwal

Copy link
Copy Markdown
Author

cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit b838233. Configure here.

@bc-vivekaggarwal bc-vivekaggarwal force-pushed the ORDERS-7764-render-create-return-page-with-context branch from b838233 to 156a8e7 Compare June 4, 2026 04:58
@bc-vivekaggarwal bc-vivekaggarwal marked this pull request as ready for review June 4, 2026 23:26
@bc-vivekaggarwal bc-vivekaggarwal requested a review from a team as a code owner June 4, 2026 23:26
@bc-vivekaggarwal bc-vivekaggarwal changed the title DRAFT: Orders 7764 render create return page with context Orders 7764 render create return page with context Jun 4, 2026
@matt-evangelidis

Copy link
Copy Markdown
Contributor

Add return page when only new flag returns_v2_enabled enabled:
Redirects to orders list page. Currently BC app doesn't support redirection when legacy returns is disabled. We need to fix this as part of ORDERS-7764

For context, what change do we need to make on the BCApp side to get redirection to work?

Comment thread assets/js/theme/create-return.js Outdated
Comment thread templates/pages/account/add-return.html
Comment thread templates/pages/account/add-return.html Outdated
@bc-vivekaggarwal

bc-vivekaggarwal commented Jun 5, 2026

Copy link
Copy Markdown
Author

Add return page when only new flag returns_v2_enabled enabled:
Redirects to orders list page. Currently BC app doesn't support redirection when legacy returns is disabled. We need to fix this as part of ORDERS-7764

For context, what change do we need to make on the BCApp side to get redirection to work?

@matt-evangelidis Good catch, updated description. The redirection fix is dependant on: ORDERS-7825
Everything else is already there:

  1. returns_v2_enabled already works now. But it comes in settings context which is currently behind STRF-13960.Settings_resource_migration. Either you turn it ON for your store or hack it in Storefront to bypass that FF.
  2. Redirection: Currently all GraphQL order related APIs return only legacy URL in API response, we need to update that as part of ORDERS-7825 to the legacy/new URL based on which returns flow is enabled. Meanwhile, use hardcoded URL /create-return/{orderId} to land on the page

Comment thread templates/pages/account/add-return.html
Comment thread templates/pages/account/add-return.html Outdated
Comment thread templates/pages/account/add-return.html
@bc-vivekaggarwal bc-vivekaggarwal requested a review from BC-SEven June 9, 2026 12:43
Comment thread templates/pages/create-return.html Outdated
Comment thread templates/pages/create-return.html
Comment thread templates/pages/create-return.html Outdated
@bc-vivekaggarwal bc-vivekaggarwal force-pushed the ORDERS-7764-render-create-return-page-with-context branch from c1e7b3e to 3f4ab78 Compare June 11, 2026 01:37
@bc-vivekaggarwal bc-vivekaggarwal merged commit a12175b into feature/PROJECT-7525-new-returns-flow Jun 11, 2026
8 checks passed
@bc-vivekaggarwal bc-vivekaggarwal deleted the ORDERS-7764-render-create-return-page-with-context branch June 11, 2026 03:32
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.

3 participants