Migrate to global currency system in commerce app
Removed per-product currency in favor of a global site currency managed via SiteConfiguration. Updated models, views, templates, and Stripe integration to use the global currency. Added migration, management command for migration, and API endpoint for currency info. Improved permissions and filtering for orders, reviews, and carts. Expanded supported currencies in configuration.
This commit is contained in:
36
backend/commerce/migrations/0003_remove_product_currency.py
Normal file
36
backend/commerce/migrations/0003_remove_product_currency.py
Normal file
@@ -0,0 +1,36 @@
|
||||
# Generated migration to remove Product.currency field and use global currency system
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('commerce', '0002_alter_productimage_options_carrier_deutschepost_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='product',
|
||||
name='currency',
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='order',
|
||||
name='currency',
|
||||
field=models.CharField(
|
||||
default='',
|
||||
help_text='Order currency - auto-filled from site configuration',
|
||||
max_length=10
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='discountcode',
|
||||
name='amount',
|
||||
field=models.DecimalField(
|
||||
blank=True,
|
||||
decimal_places=2,
|
||||
help_text='Fixed discount amount in site currency',
|
||||
max_digits=10,
|
||||
null=True
|
||||
),
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user