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:
2026-01-24 21:51:56 +01:00
parent 8f6d864b4b
commit 775709bd08
19 changed files with 371 additions and 102 deletions

View File

@@ -38,12 +38,15 @@ def send_newly_added_items_to_store_email_task_last_week():
created_at__gte=last_week_date
)
config = SiteConfiguration.get_solo()
send_email_with_context(
recipients=SiteConfiguration.get_solo().contact_email,
recipients=config.contact_email,
subject="Nový produkt přidán do obchodu",
template_path="email/advertisement/commerce/new_items_added_this_week.html",
context={
"products_of_week": products_of_week,
"site_currency": config.currency,
}
)

View File

@@ -60,7 +60,7 @@
{% if product.price %}
<div class="product-price">
{{ product.price|floatformat:0 }} {{ product.currency|default:"" }}
{{ product.price|floatformat:0 }} {{ site_currency|default:"" }}
</div>
{% endif %}