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
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:
20
orders/migrations/0003_cartitem_selected_color.py
Normal file
20
orders/migrations/0003_cartitem_selected_color.py
Normal 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='Выбранный цвет'),
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user