Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Rename pricing_info to availability

Artur Smętecedd465a536
diff --git a/saleor/product/views.py b/saleor/product/views.py
index 7b5568db26..de6f9b92f1 100644
--- a/saleor/product/views.py
+++ b/saleor/product/views.py
@@ -62,7 +62,7 @@ def product_details(request, slug, product_id):
form.save()
return redirect('cart:index')
- pricing_info = get_availability(product, discounts=request.discounts,
+ availability = get_availability(product, discounts=request.discounts,
local_currency=request.currency)
template_name = 'product/details_%s.html' % (
@@ -72,7 +72,7 @@ def product_details(request, slug, product_id):
return TemplateResponse(
request, templates,
{
- 'pricing_info': pricing_info,
+ 'availability': availability,
'product_images': product_images,
'form': form,
'is_visible': is_visible,
diff --git a/templates/product/details.html b/templates/product/details.html
index a762d40fe4..f83161b273 100644
--- a/templates/product/details.html
+++ b/templates/product/details.html
@@ -33,17 +33,17 @@
{{ product }}
</h1>
- {% if product.is_in_stock %}
+ {% if availability.available %}
<p class="lead" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
- <span class="price">{% price_range pricing_info.price_range %}</span>
- {% if pricing_info.discount %}
- <small class="price undiscounted text-muted">{% gross pricing_info.undiscounted_price_range.min_price html=True %}</small>
+ <span class="price">{% price_range availability.price_range %}</span>
+ {% if availability.discount %}
+ <small class="price undiscounted text-muted">{% gross availability.undiscounted_price_range.min_price html=True %}</small>
{% endif %}
- {% if pricing_info.price_range_local_currency %}
+ {% if availability.price_range_local_currency %}
<br>
<small class="text-info">
&asymp;
- {% gross pricing_info.price_range_local_currency.min_price html=True %}
+ {% gross availability.price_range_local_currency.min_price html=True %}
</small>
{% endif %}
</p>