Project

General

Profile

Edit Copy Actions

Support #10536

open

Bug fixes in Ecom

Added by Ajit A 24 days ago. Updated 23 days ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
Start date:
08/25/2026
Due date:
08/26/2026 (23 days late)
% Done:

100%

Estimated time:
16:00 h
Spent time:

Add

Subtasks


Add

Related issues

Actions #1

Updated by Ajit A 24 days ago

  • Subject changed from Bug fixes in Ecom & POS to Bug fixes in Ecom
  • Due date set to 08/26/2026
  • Status changed from New to In Progress
  • Estimated time set to 16:00 h

Updated by Ajit A 24 days ago

Feature Updates & Bug Fixes
1. Unified Created At Timestamp Formatting across List & Details Views
Issue: Timestamp mismatch between Order List (02:28 AM in Company Timezone EDT) and Order Details (11:58 AM in Browser Local Timezone IST).
Fix: Standardized AdminOrderView.tsx to format orderData.createdAt using formatDateTimeUSByTimezone(orderData.createdAt, getCompanyTimezone()), matching the list view.
2. Cancelled Order Product Status Update Guardrail
Issue: Admins could update product statuses and delivery dates for already-cancelled orders.
Fix:
Frontend (OrdersProductsAccordion.tsx): Disabled product row checkboxes, status select dropdowns, date pickers, and update buttons for cancelled orders. Added warning notice: 🚫 Order is cancelled — status and delivery/pickup dates cannot be modified.
Backend (order.service.js): Added validation in updateOrderDeliveryDate returning a 400 Bad Request ("Cannot update products of a cancelled order").
3. Order Cancellation Loyalty Policy Update
Requirement: Deduct earned points upon order cancellation, but do not refund redeemed points back to the customer's wallet.
Fix: Updated sale.service.js (revertSaleLoyaltyPoints & revertEcomOrderLoyaltyPoints) to reverse/deduct earned points (-earnedPoints) while disabling the redemption refund logic.
4. Partial Item Cancellation & Shipped Product Protection
Requirement: Allow customers to cancel specific unshipped products in multi-item orders while restricting cancellation for shipped items.
Fix:
Backend: Implemented POST /v1/comm/orders/:orderId/cancel-items endpoint (trust.service.js). Validates item status and rejects cancellation requests for items in shipped, in_transit, out_for_delivery, delivered, or picked states with a 400 Bad Request.
Storefront UI: Created ItemCancelModal.tsx and integrated it into OrderDetails.tsx and OrderList.tsx. Shipped items display a disabled checkbox and a Shipped (Cannot Cancel) badge. Unshipped items (pending, processing) remain selectable for partial cancellation.
5. Customer Profile Delivery Status Payload & Status Resolution Fix
Issue: Products marked Shipped in Admin Orders were still showing as Pending on the customer storefront.
Fix:
Backend (Client-controller.js): Added delivery: s.delivery to the orders and preorders response payload in getClientTransactions (/v1/client/Transactions/:clientId).
Backend (order.service.js): Synchronized normalizedStatus to order.products[i].status in updateOrderDeliveryDate.
Frontend: Updated ItemCancelModal.tsx and OrderDetailsModal.tsx to cross-reference orderData.delivery.items and orderData.pickedUpLocation when resolving line item statuses.
6. Multi-Product Order Card Display on My Orders Page
Improvement: Order cards on /evergreen/store/profile?tab=profile&subTab=orders previously displayed only the first product, causing confusion for multi-item orders.
Fix:
Updated OrderItemCard.tsx and OrderList.tsx to render all line items belonging to an order directly inside the Order Card.
Displayed line item thumbnail, name, quantity, price, and individual fulfillment status badges (SHIPPED 🟦, PROCESSING 🟨, PENDING 🟨, PICKED 🟩, CANCELLED 🟥) for each product.
Changed Files Summary
Backend (evergreen_pos_be)

Client-controller.js

ecom.route.js

trust.controller.js

trust.service.js

order.service.js

sale.service.js
Admin Frontend (evergreen_pos_fe)

AdminOrderView.tsx

OrdersProductsAccordion.tsx
E-Commerce Storefront (evergreenpos_E-commerce_new)

ecomApiPaths.ts

trustApi.ts

ItemCancelModal.tsx

OrderDetailsModal.tsx

OrderDetails.tsx

OrderItemCard.tsx

OrderList.tsx

Actions #3

Updated by Ajit A 24 days ago

  • % Done changed from 0 to 60

Updated by Ajit A 23 days ago

  • Status changed from In Progress to Resolved
  • % Done changed from 60 to 100

Feature Updates & Improvements
1. Loyalty Points Display on Admin Order Details Page (AdminOrderView.tsx)
Requirement: Display earned and redeemed reward points data on the Admin Order Details page (/dashboard/admin-order-view/:orderId).
Implementation:
Extracted pointsEarnedOnOrder, pointsRedeemedOnOrder, and loyaltyDiscountApplied from orderData.
Added Earned Points (+200 pts in an emerald badge) and Redeemed Points (110 pts ($1.10) in an amber badge) into the right-aligned summary column of the top Order Info card next to Total Amount and Paid Amount.
2. Loyalty Points Display in Admin Orders Accordion (OrdersProductsAccordion.tsx & AdminOrder.tsx)
Requirement: Display earned and redeemed reward points directly in the accordion header on the main Admin Orders list page (/dashboard/admin-orders-check).
Implementation:
Updated OrdersProductsAccordion.tsx to accept pointsEarned, pointsRedeemed, and loyaltyDiscount props.
Rendered Earned: +200 pts and Redeemed: 110 pts (
$1.10) badges directly inside the accordion header bar alongside 📦 All Products and fulfillment tags.
Updated AdminOrder.tsx to pass loyalty metrics from each order record into <OrdersProductsAccordion />.
3. Dynamic Currency Conversion on Storefront My Orders Page (OrderItemCard.tsx)
Requirement: Convert order totals, line item prices, and redeemed discount values when switching currencies (e.g. IN ₹).
Implementation:
Integrated useCurrency() context into OrderItemCard.tsx.
Replaced hardcoded fallback symbol formatting ($) with dynamic formatPrice(...) from currency context:
Product Items: Converted to active currency (Qty: 1 • ₹1,475.18).
Redeemed Points Tag: Converted discount amount to active currency (Redeemed: 110 pts (-₹90.20)).
Order Total: Converted overall total to active currency (TOTAL ₹26,231.15).
4. LocalStorage Currency Persistence & Auto-Location Protection
Requirement: Persist selected header currency in localStorage on page refresh and prevent IP location auto-detection from overwriting explicit user selection.
Implementation:
CurrencyContext.tsx: Updated setCurrency to write selected_currency_code and is_user_selected_currency = "true" to localStorage on manual selection. Initialized context state directly from localStorage.
CustomerLocationContext.tsx: Updated location sync effect to check is_user_selected_currency. If the user explicitly picked a currency (US $ or IN ₹), IP/geolocation auto-detection does not overwrite the user's currency selection on reload.
searchApi.ts: Updated request headers to parse stored currency code and metadata safely.
Changed Files Summary
Admin Frontend (evergreen_pos_fe)

AdminOrderView.tsx

OrdersProductsAccordion.tsx

AdminOrder.tsx
E-Commerce Storefront (evergreenpos_E-commerce_new)

OrderItemCard.tsx

CurrencyContext.tsx

CustomerLocationContext.tsx

searchApi.ts

Edit Copy Actions

Also available in: Atom PDF