Ajustes antes de produccion
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
endif
|
||||
|
||||
assign video_src = blank
|
||||
assign using_asset_video = false
|
||||
if section.settings.video != blank
|
||||
for source in section.settings.video.sources
|
||||
if source.mime_type == 'video/mp4' or source.format == 'mp4'
|
||||
@@ -30,16 +31,23 @@
|
||||
endfor
|
||||
endif
|
||||
if video_src == blank and section.settings.promo_link == blank
|
||||
assign video_src = 'nuevos-productos.mp4' | asset_url
|
||||
assign video_src = 'nuevos-productos-2.mp4' | asset_url
|
||||
assign using_asset_video = true
|
||||
endif
|
||||
|
||||
assign poster = section.settings.poster
|
||||
assign poster_url = blank
|
||||
if poster != blank
|
||||
if using_asset_video
|
||||
assign poster_url = 'nuevos-productos-poster.avif' | asset_url
|
||||
elsif poster != blank
|
||||
assign poster_url = poster | image_url: width: 1000
|
||||
endif
|
||||
|
||||
if video_src == blank and section.settings.promo_link != blank
|
||||
assign promo_href = section.settings.promo_link
|
||||
if promo_href == blank
|
||||
assign promo_href = more_url
|
||||
endif
|
||||
if promo_href != blank
|
||||
assign promo_tag = 'a'
|
||||
else
|
||||
assign promo_tag = 'div'
|
||||
@@ -47,7 +55,7 @@
|
||||
|
||||
assign products_to_show = section.settings.products_to_show | default: 8
|
||||
assign show_promo = false
|
||||
if poster != blank or video_src != blank
|
||||
if poster != blank or video_src != blank or using_asset_video
|
||||
assign show_promo = true
|
||||
endif
|
||||
%}
|
||||
@@ -95,10 +103,20 @@
|
||||
<{{ promo_tag }}
|
||||
class="bestsellers__promo"
|
||||
{% if promo_tag == 'a' %}
|
||||
href="{{ section.settings.promo_link }}"
|
||||
href="{{ promo_href }}"
|
||||
{% endif %}
|
||||
>
|
||||
{% if poster != blank %}
|
||||
{% if using_asset_video %}
|
||||
<img
|
||||
class="bestsellers__promo-image new-products__poster"
|
||||
src="{{ 'nuevos-productos-poster.avif' | asset_url }}"
|
||||
alt="{{ heading | escape }}"
|
||||
width="486"
|
||||
height="550"
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
>
|
||||
{% elsif poster != blank %}
|
||||
{{
|
||||
poster
|
||||
| image_url: width: 1400
|
||||
@@ -132,11 +150,19 @@
|
||||
<div class="bestsellers__slider">
|
||||
<div class="bestsellers__viewport" data-viewport tabindex="0">
|
||||
<div class="bestsellers__track" data-track>
|
||||
{% assign shown = 0 %}
|
||||
{% if product_collection != blank and product_collection.products_count > 0 %}
|
||||
{% for product in product_collection.products limit: products_to_show %}
|
||||
{% render 'bestsellers-card', product: product, form_suffix: section.id %}
|
||||
{% for product in product_collection.products %}
|
||||
{% if product.available %}
|
||||
{% render 'bestsellers-card', product: product, form_suffix: section.id %}
|
||||
{% assign shown = shown | plus: 1 %}
|
||||
{% endif %}
|
||||
{% if shown >= products_to_show %}
|
||||
{% break %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% elsif request.design_mode %}
|
||||
{% endif %}
|
||||
{% if shown == 0 and request.design_mode %}
|
||||
<p class="bestsellers__empty">{{ 'bestsellers.empty' | t }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user