You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
115 lines
5.6 KiB
115 lines
5.6 KiB
{% set cur_product = fn('wc_get_product', product.id) %}
|
|
{% set attrs = post.product.get_attributes() %}
|
|
{% set cur_weight = function('get_product_info', post.id, 'weight') %}
|
|
|
|
<div class="product__item">
|
|
<div class="product-item__label">
|
|
{% if post.date('Y-m-d') >= criteria_for_new_product %}
|
|
<span href="#" class="product-item-label__tag product-item-label__tag--new">
|
|
{{ function('pll_e', 'Новинка') }}
|
|
</span>
|
|
{% endif %}
|
|
|
|
{% if post._sale_price %}
|
|
<span href="#" class="product-item-label__tag product-item-label__tag--sale">
|
|
{{ function('pll_e', 'Распродажа %') }}
|
|
</span>
|
|
{% endif %}
|
|
</div>
|
|
<a href="{{ post.link }}" class="product-item__product-card">
|
|
<img src="{{ post.thumbnail.src('shop_single') }}" alt="{{ post.title }}" class="product-item__images">
|
|
</a>
|
|
<div class="product-item__content-card">
|
|
<div class="compound">
|
|
{% set compound = fn('wc_get_product_terms', post.id, 'pa_compound') %}
|
|
{% for option in compound %}
|
|
|
|
{% set term = get_term(option) %}
|
|
<a href="/compound/{{ term.slug }}" class="compound__item">{{ term.name }}</a>
|
|
{% endfor %}
|
|
</div>
|
|
<a href="#" class="product-item__title">{{ post.title }}</a>
|
|
<div class="product-item__price">
|
|
<p>{{ post._price() }}</p>
|
|
</div>
|
|
<div class="product-item__bye">
|
|
<button class="button button--white button--100-perc open-overlay">
|
|
{{ function('pll_e', 'Купить') }}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
<div class="product-item__overlay">
|
|
<div class="product-item-overlay__header">
|
|
<a href="#" class="product-item__title">{{ post.title }}</a>
|
|
<ul class="product-item-overlay__tags">
|
|
{% set features = fn('wc_get_product_terms', post.id, 'pa_features') %}
|
|
{% for option in features %}
|
|
{% set term = get_term(option) %}
|
|
<li>{{ term.name }}</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
|
|
<form class="product-item__form" method="post" action="/send-telegram.php">
|
|
<div class="product-item-overlay__input-block">
|
|
<div class="product-item-overlay__field">
|
|
<p class="product-item-overlay-field__title">Объем</p>
|
|
|
|
<div class="select">
|
|
<input type="text" class="select__state" value="{{ cur_weight }}" readonly data-product_id="{{post.id}}" data-product_price="{{ post._price() }}">
|
|
<div class="state__block">
|
|
<ul class="state__content">
|
|
{% set collection = fn('wc_get_product_terms', post.id, 'pa_collection') %}
|
|
{% for option in collection %}
|
|
{% set term = get_term(option) %}
|
|
{% set siblings = function('get_collection_siblings' , term.id) %}
|
|
|
|
{% for sibling in siblings %}
|
|
|
|
{% set weight = function('get_product_info', sibling.ID, 'weight') %}
|
|
|
|
{% set class = '' %}
|
|
{% if weight == cur_weight %}
|
|
{% set class = 'active' %}
|
|
{% endif %}
|
|
<li>
|
|
<button class="state__button {{ class }}" data-product_id="{{sibling.ID}}" data-product_price="{{ function('get_product_info', sibling.ID, 'price') }}">
|
|
{{ weight }}
|
|
</button>
|
|
</li>
|
|
{% endfor %}
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="product-item-overlay__field">
|
|
<p class="product-item-overlay-field__title">Количество</p>
|
|
|
|
<div class="counter">
|
|
<button class="counter__button minus">
|
|
<img src="{{ theme.link }}/woocommerce/assets/img/svg/main/minus.svg" alt="">
|
|
</button>
|
|
<input type="text" class="counter__input" value="1">
|
|
<button class="counter__button plus">
|
|
<img src="{{ theme.link }}/woocommerce/assets/img/svg/main/plus.svg" alt="">
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<p class="product-item-overlay__price">
|
|
{{ post._price() }}
|
|
</p>
|
|
<div class="product-item-overlay__block-button">
|
|
<div class="product-item-overlay__button">
|
|
{{ function('get_add_to_cart_button', post.id) }}
|
|
</div>
|
|
<div class="product-item-overlay__more_button">
|
|
<a class="to-know button--100-perc" href="{{ post.link }}">
|
|
<p>{{ function('pll_e', 'Подробнее') }}</p>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div> |