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:
@@ -44,9 +44,17 @@ class SiteConfiguration(models.Model):
|
||||
addition_of_coupons_amount = models.BooleanField(default=False, help_text="Sčítání slevových kupónů v objednávce (ano/ne), pokud ne tak se použije pouze nejvyšší slevový kupón")
|
||||
|
||||
class CURRENCY(models.TextChoices):
|
||||
CZK = "CZK", "Czech Koruna"
|
||||
EUR = "EUR", "Euro"
|
||||
currency = models.CharField(max_length=10, default=CURRENCY.CZK, choices=CURRENCY.choices)
|
||||
CZK = "CZK", "Czech Koruna"
|
||||
USD = "USD", "US Dollar"
|
||||
GBP = "GBP", "British Pound"
|
||||
PLN = "PLN", "Polish Zloty"
|
||||
HUF = "HUF", "Hungarian Forint"
|
||||
SEK = "SEK", "Swedish Krona"
|
||||
DKK = "DKK", "Danish Krone"
|
||||
NOK = "NOK", "Norwegian Krone"
|
||||
CHF = "CHF", "Swiss Franc"
|
||||
currency = models.CharField(max_length=10, default=CURRENCY.EUR, choices=CURRENCY.choices)
|
||||
|
||||
class Meta:
|
||||
verbose_name = "Shop Configuration"
|
||||
|
||||
Reference in New Issue
Block a user