Bug #10895
openBug fixes in E-commerce and admin dashboard in subscription branch
Subtasks
Related issues
Updated by Ajit A about 20 hours ago
- Status changed from New to Resolved
- % Done changed from 0 to 100
- Estimated time set to 8:00 h
🏬 1. E-Commerce Storefront (evergreenpos_E-commerce_new)
A. Navigation & Scope Bug Fixes
src/features/products/components/UnifiedCard.tsx:
Issue: tenantNavigate("/cart") threw a runtime/TypeScript error Cannot find name 'tenantNavigate'.
Fix: Added const tenantNavigate = useTenantNavigate() to initialize the navigation hook within the component body. Cleaned up unused Lucide icons (ShoppingCart, Star, Minus, Plus, CheckCircle) and duplicate interface properties (_id in Category).
src/features/products/components/ProductUnifiedCard.tsx:
Adjusted quantity stepper dimensions (w-[62px] sm: w-[68px]) and button padding/flex properties to ensure clean alignment on smaller screens.
Styled the "Go to Cart" button with distinct badge colors (bg-[#dcfce7], text-[#15803d], hover states) and forced label visibility across breakpoints.
B. Header Search & Category Navigation
src/layout/headers/Header.tsx:
Refactored search suggestions to bind category names to their respective id and categoryName.
Updated click handlers so clicking a category suggestion routes directly to /related-products/:catId (with category state attached) instead of doing a generic text query search.
C. Tenant Host & Multi-Tenant Settings Resolution
src/utils/tenantHost.ts:
Updated resolveActiveTenantSlug() to add a URL pathname fallback parser (e.g., /evergreen/... or /nursery/evergreen/...).
Ensures storefront components maintain tenant context even when localStorage.getItem('tenant_slug') is empty or cleared.
Multi-Tenant Settings Scoping:
Updated useCompanySettings(slug) callers across multiple pages to explicitly supply the active tenant slug (slug || undefined), ensuring company feature flags and settings load accurately for the active store:
src/features/dashboard/componets/ProductCard.tsx
src/layout/Contact/Contact.tsx
src/layout/Policy/PolicyPage.tsx
src/features/content/pages/FaqPage.tsx
src/features/dashboard/componets/PreorderProducts.tsx
src/features/dashboard/componets/Preorderlistpage.tsx
src/features/dashboard/componets/RecentlyViewedSection.tsx
src/features/pre-orders/pages/PreOrderProductsPage.tsx
src/components/GardeningClubPopup.tsx
D. Checkout Summary & UX Cleanup
src/features/checkout/pages/Checkout.tsx & CheckoutPreorder.tsx:
Formatted summary totals for coupon line discounts, reward points, gift cards, referral credits, and gift wrap fees.
Removed obsolete warning banners for payment method loading.
⚙️ 2. Backend Service (evergreen_pos_be)
src/services/nursery/trust.service.js:
Fix: Updated listProductReviews filter logic when pid is a valid MongoDB ObjectId to query with { _id: pid } directly instead of casting it to { _id: String(pid) }, preventing empty review lookup results.
src/services/nursery/order.service.js:
Code formatting and whitespace cleanup before await order.save().