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:
@@ -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,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
|
||||
{% if product.price %}
|
||||
<div class="product-price">
|
||||
{{ product.price|floatformat:0 }} {{ product.currency|default:"Kč" }}
|
||||
{{ product.price|floatformat:0 }} {{ site_currency|default:"€" }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user