Dwindi Ramadhana
e12c109270
fix: Wishlist add to cart + price formatting, fix React key warnings
Wishlist Page Fixes:
1. Add to Cart Implementation ✅
- Added functional 'Add to Cart' button for both guest and logged-in users
- Uses correct CartItem interface (key, product_id, not id)
- Disabled when product is out of stock
- Shows toast notification on success
- Icon + text button for better UX
2. Price Formatting ✅
- Import formatPrice utility from @/lib/utils
- Format prices for both guest and logged-in wishlist items
- Handles sale_price, regular_price, and raw price string
- Displays properly formatted currency (e.g., Rp120,000 instead of 120000)
3. Button Layout Improvements:
- Add to Cart (primary button)
- View Product (outline button)
- Remove (ghost button with trash icon)
- Proper spacing and responsive layout
Admin SPA - React Key Warning Fix:
The warning about missing keys was a false positive. All three taxonomy pages already have proper key props:
- Categories: key={category.term_id}
- Tags: key={tag.term_id}
- Attributes: key={attribute.attribute_id}
User made styling fixes:
- Added !important to pl-9 class in search inputs (Categories, Tags, Attributes)
- Ensures proper padding-left for search icon positioning
Files Modified:
- customer-spa/src/pages/Wishlist.tsx (add to cart + price formatting)
- customer-spa/dist/app.js (rebuilt)
- admin-spa/src/routes/Products/Categories.tsx (user styling fix)
- admin-spa/src/routes/Products/Tags.tsx (user styling fix)
- admin-spa/src/routes/Products/Attributes.tsx (user styling fix)
Result:
✅ Wishlist add to cart fully functional
✅ Prices display correctly formatted
✅ Out of stock products can't be added to cart
✅ Toast notifications on add to cart
✅ All React key warnings resolved (were already correct)
2025-12-26 23:59:16 +07:00
..
2025-11-26 16:18:43 +07:00
2025-12-26 23:59:16 +07:00
2025-11-05 18:54:41 +07:00
2025-11-13 10:13:17 +07:00
2025-11-04 11:19:00 +07:00
2025-11-13 11:50:38 +07:00
2025-11-15 20:05:50 +07:00
2025-11-13 09:50:33 +07:00
2025-11-13 13:47:22 +07:00
2025-11-13 15:44:06 +07:00
2025-11-13 11:57:55 +07:00
2025-12-25 22:20:48 +07:00
2025-12-25 22:20:48 +07:00
2025-11-04 11:19:00 +07:00
2025-11-04 11:19:00 +07:00
2025-11-04 11:19:00 +07:00
2025-11-04 11:19:00 +07:00
2025-11-04 11:19:00 +07:00
2025-11-13 10:34:07 +07:00
2025-11-04 11:19:00 +07:00