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

@@ -0,0 +1,20 @@
# Generated by Django 6.0.5 on 2026-05-25 22:37
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('items', '0005_remove_item_color_item_colors'),
('orders', '0002_order_orderitem'),
]
operations = [
migrations.AddField(
model_name='cartitem',
name='selected_color',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='items.color', verbose_name='Выбранный цвет'),
),
]