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

dev_10_fixbugs
Andrei 2 months ago
parent ad9ed0fb00
commit 272909cf61
  1. 15
      wp-content/themes/cosmopet/templates/_blocks/shop/archive-product-tease.twig
  2. 33
      wp-content/themes/cosmopet/woocommerce/assets/css/gp-style-core.css
  3. 1
      wp-content/themes/cosmopet/woocommerce/assets/css/gp-style-desktop.css

@ -2,8 +2,9 @@
{% set cur_product = fn('wc_get_product', post.id) %} {% set cur_product = fn('wc_get_product', post.id) %}
{% set attrs = post.product.get_attributes() %} {% set attrs = post.product.get_attributes() %}
{% set cur_weight = function('get_product_info', post.id, 'weight') %} {% set cur_weight = function('get_product_info', post.id, 'weight') %}
{% set stock_status = post.meta('_stock_status') == 'instock' %}
<div class="product__item"> <div class="product__item {% if not stock_status == 'instock' %}hiding{% endif %}">
<div class="product-item__label"> <div class="product-item__label">
{% if post.date('Y-m-d') >= criteria_for_new_product %} {% if post.date('Y-m-d') >= criteria_for_new_product %}
<span class="product-item-label__tag product-item-label__tag--new"> <span class="product-item-label__tag product-item-label__tag--new">
@ -50,8 +51,18 @@
<a href="{{ post.link }}" class="product-item__title">{{ post.title }}</a> <a href="{{ post.link }}" class="product-item__title">{{ post.title }}</a>
<div class="product-item__price"> <div class="product-item__price">
<p>{{ post._price() }} {{ fn('get_woocommerce_currency_symbol') }}</p> <p>{{ post._price() }} {{ fn('get_woocommerce_currency_symbol') }}</p>
{% if post._regular_price() and post._regular_price() > post._price() %}
<div class="product-item__price-disc">
<p class="product-item__price-sale__text">
{{ post._regular_price() }} {{ fn('get_woocommerce_currency_symbol') }}
</p>
<p class="product-item__price-sale__perc">
- {{ ((1 - post._price() / post._regular_price()) * 100)|round(0, 'floor') }} %
</p>
</div>
{% endif %}
</div> </div>
{% set stock_status = post.meta('_stock_status') == 'instock' %}
{% if stock_status == 'instock' %} {% if stock_status == 'instock' %}
<div class="product-item__bye"> <div class="product-item__bye">
<button class="button button--white button--100-perc open-overlay"> <button class="button button--white button--100-perc open-overlay">

@ -1307,3 +1307,36 @@ button{
.compound{ .compound{
flex-wrap: wrap; flex-wrap: wrap;
} }
.product__item.hiding .product-item__price p {
color: #999;
}
.product-item__price-disc, .product-item__price {
display: flex;
align-items: center;
gap: 20px;
}
.product-item__price-disc, .product-item__price{
display: flex;
align-items: center;
gap: 20px;
}
.product-item__price-sale__perc{
font-size: 20px;
text-transform: uppercase;
color: #FA0505;
}
.product-item__price-sale__text {
text-decoration: line-through;
color: #999999;
font-size: 18px;
}
.product-item__price-sale__perc::after{
display: none;
}

@ -545,7 +545,6 @@ main{
font-size: 20px; font-size: 20px;
line-height: 200%; line-height: 200%;
text-transform: uppercase; text-transform: uppercase;
color: var(--text-black);
} }
/* .product-item__price p::after{ /* .product-item__price p::after{
content: '₽'; content: '₽';

Loading…
Cancel
Save