Andrei | фикс каталога (вывод акционной цены и скидки при ее наличии на странице товара)

dev_10_fixbugs
Andrei 2 months ago
parent 8180ba14cf
commit 076af73a9b
  1. 1
      wp-content/themes/cosmopet/global-functions/core-functions.php
  2. 6
      wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-desktop.css
  3. 12
      wp-content/themes/cosmopet/modules/shop/components/single-product/component-template.twig

@ -260,4 +260,3 @@ $zero = '0';
// ]); // ]);
// } // }

@ -1059,8 +1059,14 @@ main{
display: flex; display: flex;
} }
.detail__catalot .product__item{ .detail__catalot .product__item{
width: calc(100% - 24px);
}
@media (max-width: 640px) {
.detail__catalot .product__item{
width: calc(100%); width: calc(100%);
} }
}
.detail__images-phone{ .detail__images-phone{
display: none; display: none;
} }

@ -101,6 +101,18 @@
{% else %} {% else %}
<p class="detail-block-price__price"> <p class="detail-block-price__price">
{{ product.get_price }} {{ fn('get_woocommerce_currency_symbol') }} {{ product.get_price }} {{ fn('get_woocommerce_currency_symbol') }}
{% if product.is_on_sale %}
<div class="detail-block-price__sale">
<p class="detail-block-price-sale__text">
{{ product.get_regular_price }} {{ fn('get_woocommerce_currency_symbol') }}
</p>
<p class="detail-block-price-sale__perc">
{% set discount = ((product.get_regular_price - product.get_sale_price) / product.get_regular_price * 100)|round(0, 'floor') %}
{{ discount }}
</p>
</div>
{% endif %}
</p> </p>
{% endif %} {% endif %}
</div> </div>

Loading…
Cancel
Save