- Create LoadingSpinner component with spinning circle
- Wrap products grid with Suspense boundary
- Shows spinner while products are loading
- Improves UX for slower connections
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Remove search, category, color, and price filters from products and
made-to-order pages. Keep only simple pagination for browsing.
Simplifies UX and removes unnecessary database queries:
- No category/collection queries needed
- No palette generation
- No filter logic
Much cleaner pages with faster load times.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Add pagination to products and made-to-order pages (20 per page)
- Cache color palette separately for ready-made and personalised
- Fix category queries to use select instead of include
- Calculate total page count for pagination UI
- Add Previous/Next pagination controls
Solves N+1 query problem on color palette generation. With 100+ products:
- Before: Loading all 10,000 products just for color palette
- After: Load palette once (cached 5 mins), show 20 products per page
Updated shop pages (/made-to-order and /products) to show categories
hierarchically in the filter sidebar. Now displays both parent and
child categories with visual hierarchy (e.g., "Apparel > Adults").
Changes:
- Query only parent categories (parentId = null) with children included
- Build flat category list showing hierarchy with > separator
- Filter logic remains unchanged - still filters by category slug
- Child categories only show if parent has showOnPersonalised/showOnProducts enabled
User experience:
- See all available category options
- Visual indication of subcategories (Apparel > Adults, Apparel > Kids, etc.)
- Click to filter by any level
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Updates pricing logic to use correct price based on product type:
- Updated getEffectivePrice to accept priceType parameter ('base', 'plain', 'personalised')
- Updated toProductDTO to accept and use priceType when computing effective price
- Updated made-to-order pages to use 'personalised' price type
- Updated products catalog pages to use 'plain' price type
- Updated checkout logic to determine price type based on design
Pricing behavior:
- Personalised orders (with design): use personalisedPrice if set, else basePrice
- Plain/blank orders (no design): use plainPrice if set, else basePrice
- Ready-made orders (no design, no plainPrice): use basePrice
All prices now correctly reflect the product variant being purchased.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>