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.
56 lines
2.9 KiB
56 lines
2.9 KiB
{# TO_DO:
|
|
|
|
1) в контроллер вынести получение всех переменных, а не тут выхывать функции fn()
|
|
2) переименовать в файл /shop/product-card.twig
|
|
3) _product, wc_product, s_product -- не понятно почему множество переменных с одинаковым смыслом =>
|
|
надо сделать единый контенкст для всех контроллеров и там создать все нужные переменные
|
|
|
|
#}
|
|
|
|
<div class="main-food_products-card {{addClass}} {{ item.getTasteClass() }}">
|
|
<a href="{{item.link}}" class="main-food_products-card-slider">
|
|
<div class="swiper-wrapper">
|
|
{% set image_list = item.getImageGallery('medium') %}
|
|
{% if image_list %}
|
|
{% for image in image_list %}
|
|
<div class="swiper-slide">
|
|
<div class="main-food_products-card-img">
|
|
<img src="{{ image.url }}" alt="{{ image.alt }}">
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
<div class="swiper-dots"></div>
|
|
</div>
|
|
</a>
|
|
<div class="">
|
|
|
|
|
|
<a href="{{item.link}}" class="main-food_products-card-title">
|
|
{{item.title}}
|
|
</a>
|
|
|
|
{% set size_siblings = post.getSizeSiblings %}
|
|
{% if size_siblings %}
|
|
<div class="main-food_products-card__weight">
|
|
|
|
{% for sibling in size_siblings %}
|
|
{% set class = '' %}
|
|
{% if sibling.get_weight == item.get_weight %}
|
|
{% set class = 'active' %}
|
|
{% endif %}
|
|
{% if sibling.get_weight %}
|
|
<button class="main-food_products-card__weight-item {{ class }}" data-image-set='{{ sibling.getImageGallery('medium')|json_encode() }}' data-product_id="{{sibling.id}}" data-product_price="{{sibling.getPrice}}" data-title="{{sibling.title}}">
|
|
{{ sibling.get_weight }}
|
|
</button>
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
</div>{% endif %}
|
|
<div class="main-food_products-card-bottom">
|
|
<div class="main-food_products-card-bottom-price">{{item.getPriceWithCurrency}}</div>
|
|
<a href="{{ item.product.add_to_cart_url }}" class="main-food_products-cardbottom-btn ajax_add_to_cart add_to_cart_button" data-product_id="{{ item.id }}"
|
|
data-product_sku="{{ item.sku|e('html_attr') }}">{{ fn('pll_e', 'В корзину') }}</a>
|
|
</div>
|
|
</div>
|
|
</div> |