{% macro item(product, category, cols) %}
{{ product.name }} {# Flags #} {% if product.track_stock == 1 and product.quantity <= 0 %}
{{ lang('out_of_stock') }}
{% else %} {% set sale = false %} {% for category in product.categories %} {% if categories_flatten[category.id].slug == 'sale' %}
Promoção
{% set sale = true %} {% endif %} {% endfor %} {% if product.saleprice > 0 and not sale %}
{{ (((product.saleprice - product.price) / product.price) * 100)|round }}%
{% endif %} {% endif %}
{% set product_price = product.saleprice > 0 ? product.saleprice : product.price %}

{{ (product.saleprice > 0 ? '' ~ product.price|format_currency ~ '' : '')|raw }} {{ product_price|format_currency }}

{% if product.installments > 0 %}

{{ product.installments }}x {{ (product_price/product.installments)|format_currency }} {{ 'S/ JUROS'|trans({'en':''}) }}

{% endif %}
{% endmacro %}