Skip to content

Returns portal#70

Open
mateo-agilo wants to merge 49 commits into
masterfrom
feat/returns
Open

Returns portal#70
mateo-agilo wants to merge 49 commits into
masterfrom
feat/returns

Conversation

@mateo-agilo

@mateo-agilo mateo-agilo commented Mar 10, 2026

Copy link
Copy Markdown
Contributor

No description provided.

…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
- 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.
@medusajs

medusajs Bot commented Mar 10, 2026

Copy link
Copy Markdown
Name Backend Status Storefront Status Preview Link Last Updated
agilo-dtc-starter ✅ Ready - Admin / - Tue, 09 Jun 2026 09:12:15 GMT

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread storefront/src/modules/returns/templates/GuestReturnTrackForm.tsx
Comment thread storefront/src/modules/returns/templates/GuestReturnCreateForm.tsx
Comment thread storefront/src/modules/returns/templates/ReturnDetailsTemplate.tsx Outdated
Comment thread storefront/src/modules/returns/templates/ReturnCreationTemplate.tsx
Comment thread storefront/src/lib/data/returns.ts
Comment thread storefront/src/modules/order/components/OrderTotals.tsx Outdated
Comment thread storefront/src/modules/order/components/OrderTag.tsx
Comment thread storefront/src/modules/returns/templates/ReturnCreationTemplate.tsx
Comment thread storefront/src/app/[countryCode]/(main)/account/my-orders/[orderId]/page.tsx Outdated

Copilot AI commented Mar 10, 2026

Copy link
Copy Markdown
Contributor

@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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread storefront/src/modules/returns/templates/ReturnCreationTemplate.tsx
Comment thread storefront/src/modules/returns/components/ReturnStatus.tsx Outdated
Comment thread storefront/src/modules/order/components/item/OrderItem.tsx Outdated
Comment thread storefront/src/app/[countryCode]/(main)/return-policy/page.tsx
Comment thread storefront/src/modules/returns/templates/GuestReturnCreateForm.tsx
Comment thread storefront/src/modules/returns/templates/GuestReturnTrackForm.tsx
@anteprimorac anteprimorac changed the title Feat/returns Returns portal Jun 5, 2026
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.

5 participants