diff --git a/wp-content/themes/cosmopet/templates/_blocks/shop/archive-product-tease.twig b/wp-content/themes/cosmopet/templates/_blocks/shop/archive-product-tease.twig index 0599771..52f7945 100644 --- a/wp-content/themes/cosmopet/templates/_blocks/shop/archive-product-tease.twig +++ b/wp-content/themes/cosmopet/templates/_blocks/shop/archive-product-tease.twig @@ -2,8 +2,9 @@ {% set cur_product = fn('wc_get_product', post.id) %} {% set attrs = post.product.get_attributes() %} {% set cur_weight = function('get_product_info', post.id, 'weight') %} - -
+ {% set stock_status = post.meta('_stock_status') == 'instock' %} + +
{% if post.date('Y-m-d') >= criteria_for_new_product %} @@ -49,9 +50,19 @@
{{ post.title }}
-

{{ post._price() }} {{ fn('get_woocommerce_currency_symbol') }}

+

{{ post._price() }} {{ fn('get_woocommerce_currency_symbol') }}

+ + {% if post._regular_price() and post._regular_price() > post._price() %} +
+

+ {{ post._regular_price() }} {{ fn('get_woocommerce_currency_symbol') }} +

+

+ - {{ ((1 - post._price() / post._regular_price()) * 100)|round(0, 'floor') }} % +

+
+ {% endif %}
- {% set stock_status = post.meta('_stock_status') == 'instock' %} {% if stock_status == 'instock' %}