Returns portal#70
Conversation
…and tracking - Add SidebarNav component with a link to "My returns" - Create OrderItem component for displaying individual order items - Implement RefundMethodSelect for selecting refund methods - Add ReturnProductItem for managing return items with quantity and reason selection - Create ReturnReasonSelect for selecting return reasons - Implement ReturnShippingOptions for choosing return shipping methods - Add ReturnStatusTracker to display the status of returns - Create ReturnSummary to summarize return details and refund amounts - Implement ReturnCreationTemplate for managing return requests - Add ReturnTrackingTemplate for tracking return status and details
…w return request handling
- Added a new Refresh icon component. - Introduced OrderReturnStatus type and getOrderReturnStatus function to manage return status. - Removed the My Returns link from the SidebarNav component. - Deleted RefundMethodSelect and ReturnProductItem components. - Created ReturnItemSelector component for selecting items to return with quantity and reason. - Deleted ReturnShippingOptions component and created ReturnShippingSelector for handling shipping options. - Updated ReturnSummary to simplify refund calculations. - Refactored ReturnCreationTemplate to integrate new components and streamline return request submission.
…urn details handling
…ed order status handling
…turn item calculations
… and new return status component
…tabs for multiple returns
… names for guest view
…mprove return check logic
|
There was a problem hiding this comment.
Pull request overview
Adds end-to-end “Returns” functionality to the storefront, including guest return creation/tracking and account-based return initiation/details, plus supporting UI components and pricing/summary adjustments.
Changes:
- Introduces guest return flows: create return (order lookup) and track return (lookup + details page).
- Adds returns UI building blocks (status, summary, item selector, shipping selector) and a lightweight Tabs component.
- Updates order/cart pricing display and order/account pages to surface return status/actions and revised totals.
Reviewed changes
Copilot reviewed 47 out of 47 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
| storefront/src/modules/returns/templates/ReturnDetailsTemplate.tsx | Renders return details (supports multiple returns via tabs). |
| storefront/src/modules/returns/templates/ReturnCreationTemplate.tsx | Client template to select return items, shipping option, and submit return request. |
| storefront/src/modules/returns/templates/GuestReturnTrackForm.tsx | Guest form to track a return by order id + email. |
| storefront/src/modules/returns/templates/GuestReturnCreateForm.tsx | Guest form to start a return by verifying order access. |
| storefront/src/modules/returns/components/ReturnSummary.tsx | Displays a return-value summary for selected items. |
| storefront/src/modules/returns/components/ReturnStatus.tsx | Displays return status tags (requested/received/refunded). |
| storefront/src/modules/returns/components/ReturnShippingSelector.tsx | Lists return shipping options and calculates “calculated” prices. |
| storefront/src/modules/returns/components/ReturnReasonSelect.tsx | Select control for return reasons (react-aria select). |
| storefront/src/modules/returns/components/ReturnItemSelector.tsx | UI to pick return quantities, reasons, notes, and show per-item refund. |
| storefront/src/modules/products/components/product-price/index.tsx | Makes discounted price more visually prominent (font weight). |
| storefront/src/modules/order/templates/order-completed-template.tsx | Passes currency code into item rendering for correct formatting. |
| storefront/src/modules/order/components/item/index.tsx | Extends order line item component to accept currency code for pricing. |
| storefront/src/modules/order/components/item/OrderItem.tsx | New shared “order/return item” presentation component with discount display. |
| storefront/src/modules/order/components/OrderTotals.tsx | Adjusts totals calculation to derive discounts/items totals. |
| storefront/src/modules/order/components/OrderTag.tsx | New tag component for order status with return-aware states. |
| storefront/src/modules/order/components/OrderStatus.tsx | New order-status tag list component (packing/delivering/delivered/canceled). |
| storefront/src/modules/common/components/line-item-unit-price/index.tsx | Switches unit price rendering to convertToLocale and adds required currencyCode prop. |
| storefront/src/modules/common/components/cart-totals/index.tsx | Uses item_subtotal instead of subtotal for cart subtotal display. |
| storefront/src/modules/checkout/templates/checkout-summary/index.tsx | Makes discounted price more visually prominent (font weight). |
| storefront/src/modules/cart/templates/items.tsx | Requires/threads currencyCode down to cart line items. |
| storefront/src/modules/cart/templates/index.tsx | Passes cart currency code into items template. |
| storefront/src/modules/cart/components/item/index.tsx | Requires currencyCode and passes it into LineItemUnitPrice. |
| storefront/src/modules/cart/components/cart-totals/index.tsx | Uses item_subtotal instead of subtotal for subtotal + data attributes. |
| storefront/src/modules/auth/components/LoginForm.tsx | Avoids showing an error message before any submission result exists. |
| storefront/src/modules/account/components/SidebarNav.tsx | Adjusts sidebar link layout classes. |
| storefront/src/lib/util/returns.ts | Adds return coverage helpers, returnability helpers, and refund calculations. |
| storefront/src/lib/data/returns.ts | Adds server actions for listing return reasons/options and creating/tracking guest returns. |
| storefront/src/lib/data/orders.ts | Expands fetched fields to include returns and additional line-item fields. |
| storefront/src/lib/data/fulfillment.ts | Adds API call to calculate shipping option price for a cart. |
| storefront/src/lib/data/cookies.ts | Adds cache tag helpers for per-session cache tagging. |
| storefront/src/components/ui/Tag.tsx | Adjusts tag text styling and default color behavior. |
| storefront/src/components/ui/Tabs.tsx | Adds a simple tabs implementation for client-side tab state. |
| storefront/src/components/icons/Undo.tsx | Updates Undo icon stroke attributes and path. |
| storefront/src/components/icons/Refresh.tsx | Adds a new Refresh icon used for return-related tags. |
| storefront/src/components/Icon.tsx | Registers the new refresh icon name and component. |
| storefront/src/components/HeaderWrapper.tsx | Adds optional chaining for pathname parsing and sticky checks. |
| storefront/src/components/Footer.tsx | Updates footer “Returns” link to route to /returns. |
| storefront/src/components/CartDrawer.tsx | Threads cart currency code into cart item rendering. |
| storefront/src/app/[countryCode]/(main)/returns/track/page.tsx | Adds guest return tracking entry page. |
| storefront/src/app/[countryCode]/(main)/returns/track/[orderId]/page.tsx | Adds guest return details page (by order id). |
| storefront/src/app/[countryCode]/(main)/returns/page.tsx | Adds guest “start a return” entry page. |
| storefront/src/app/[countryCode]/(main)/returns/create/page.tsx | Adds guest return creation page (order + email in query). |
| storefront/src/app/[countryCode]/(main)/return-policy/page.tsx | Adds a return policy content page and links from flows. |
| storefront/src/app/[countryCode]/(main)/account/my-orders/page.tsx | Adds return actions and return-aware status tags on orders list. |
| storefront/src/app/[countryCode]/(main)/account/my-orders/[orderId]/return/page.tsx | Adds account return creation page per order. |
| storefront/src/app/[countryCode]/(main)/account/my-orders/[orderId]/return/[returnId]/page.tsx | Adds account return details page per return. |
| storefront/src/app/[countryCode]/(main)/account/my-orders/[orderId]/page.tsx | Adds returns section and updates order item rendering/headers/status display. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… handling of undefined values
|
@mateo-agilo I've opened a new pull request, #71, to work on those changes. Once the pull request is ready, I'll request review from you. |
…y return handling
…r with fetchAndVerifyOrder across return-related components
… getReturnCoverage
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 52 out of 52 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.