feat: enable color selection for cart items and enhance UI integration
All checks were successful
Build and Push Docker Image / build (push) Successful in 38s

- Added `selected_color` field to `CartItem` model with migration
- Updated color swatch behavior on product detail page with selection logic and disabled button handling
- Improved cart templates to display selected color alongside item details
- Modified `add_item_to_cart` service and `add` view to handle color selection
- Enhanced styles for active swatches and cart item color display
This commit is contained in:
2026-05-26 03:12:00 +02:00
parent af129309ab
commit 56af404dc9
8 changed files with 79 additions and 5 deletions

View File

@@ -34,6 +34,9 @@
<div class="cart-item__info">
<a class="cart-item__title" href="{% url 'detail' item.category.slug item.slug %}">{{ item.name }}</a>
{% if cart_item.selected_color %}
<span class="cart-item__color">({{ cart_item.selected_color.name }})</span>
{% endif %}
<p class="cart-item__price">{{ item.price }} руб.</p>
<div class="cart-item__controls">