Ajustes antes de produccion
This commit is contained in:
+72
-140
@@ -10,51 +10,102 @@
|
||||
endif
|
||||
|
||||
assign banner_title = collection.metafields.custom.banner_titulo.value | default: collection.metafields.custom.banner_title.value
|
||||
if banner_title == blank
|
||||
assign banner_title = collection.title
|
||||
endif
|
||||
|
||||
assign banner_asset = blank
|
||||
assign directory_title = blank
|
||||
assign directory_text = blank
|
||||
case collection.handle
|
||||
when 'all-products'
|
||||
assign banner_asset = 'banner-todos-productos.avif'
|
||||
when 'proteccion-solar-1'
|
||||
assign banner_asset = 'banner-proteccion-solar.avif'
|
||||
assign directory_title = 'category_directory.sun_title' | t
|
||||
assign directory_text = 'category_directory.sun_text' | t
|
||||
when '4-protege-bloqueadores-solares'
|
||||
assign banner_asset = 'banner-protectores.avif'
|
||||
assign directory_title = 'category_directory.protect_title' | t
|
||||
assign directory_text = 'category_directory.protect_text' | t
|
||||
when 'hidratantes'
|
||||
assign banner_asset = 'banner-hidratantes.avif'
|
||||
assign directory_title = 'category_directory.moisturizers_title' | t
|
||||
assign directory_text = 'category_directory.moisturizers_text' | t
|
||||
when 'limpiadores'
|
||||
assign banner_asset = 'banner-limpiadores.avif'
|
||||
assign directory_title = 'category_directory.cleansers_title' | t
|
||||
assign directory_text = 'category_directory.cleansers_text' | t
|
||||
when 'mascarillas'
|
||||
assign banner_asset = 'banner-mascarillas.avif'
|
||||
assign directory_title = 'category_directory.masks_title' | t
|
||||
assign directory_text = 'category_directory.masks_text' | t
|
||||
when 'serum'
|
||||
assign banner_asset = 'banner-serums.avif'
|
||||
assign directory_title = 'category_directory.serum_title' | t
|
||||
assign directory_text = 'category_directory.serum_text' | t
|
||||
when '1-limpia'
|
||||
assign banner_asset = 'banner-limpia.avif'
|
||||
assign directory_title = 'category_directory.clean_title' | t
|
||||
assign directory_text = 'category_directory.clean_text' | t
|
||||
when '2-trata'
|
||||
assign banner_asset = 'banner-trata.avif'
|
||||
assign directory_title = 'category_directory.treat_title' | t
|
||||
assign directory_text = 'category_directory.treat_text' | t
|
||||
when '3-hidrata'
|
||||
assign banner_asset = 'banner-hidrata.avif'
|
||||
assign directory_title = 'category_directory.hydrate_step_title' | t
|
||||
assign directory_text = 'category_directory.hydrate_step_text' | t
|
||||
when 'kits-skincare-facial'
|
||||
assign banner_asset = 'banner-kits.avif'
|
||||
when 'piel-mixta-grasa'
|
||||
assign banner_asset = 'banner-piel-mixta-grasa.avif'
|
||||
assign directory_title = 'category_directory.combination_title' | t
|
||||
assign directory_text = 'category_directory.combination_text' | t
|
||||
when 'piel-grasa'
|
||||
assign banner_asset = 'banner-piel-grasa.avif'
|
||||
assign directory_title = 'category_directory.oily_title' | t
|
||||
assign directory_text = 'category_directory.oily_text' | t
|
||||
when 'piel-seca-1'
|
||||
assign banner_asset = 'banner-piel-seca.avif'
|
||||
assign directory_title = 'category_directory.dry_title' | t
|
||||
assign directory_text = 'category_directory.dry_text' | t
|
||||
when 'control-grasa'
|
||||
assign banner_asset = 'banner-control-grasa.avif'
|
||||
assign directory_title = 'category_directory.oil_title' | t
|
||||
assign directory_text = 'category_directory.oil_text' | t
|
||||
when 'acne-1'
|
||||
assign banner_asset = 'banner-preocupacion-acne.avif'
|
||||
assign directory_title = 'category_directory.acne_title' | t
|
||||
assign directory_text = 'category_directory.acne_text' | t
|
||||
when 'hidratacion'
|
||||
assign banner_asset = 'banner-preocupacion-hidratacion.avif'
|
||||
assign directory_title = 'category_directory.hydration_title' | t
|
||||
assign directory_text = 'category_directory.hydration_text' | t
|
||||
when 'antiedad-1'
|
||||
assign banner_asset = 'banner-antiedad.avif'
|
||||
assign directory_title = 'category_directory.aging_title' | t
|
||||
assign directory_text = 'category_directory.aging_text' | t
|
||||
when 'aclarar'
|
||||
assign banner_asset = 'banner-manchas.avif'
|
||||
assign directory_title = 'category_directory.spots_title' | t
|
||||
assign directory_text = 'category_directory.spots_text' | t
|
||||
endcase
|
||||
|
||||
if banner_title == blank
|
||||
if directory_title != blank
|
||||
assign banner_title = directory_title
|
||||
else
|
||||
assign banner_title = collection.title
|
||||
endif
|
||||
endif
|
||||
|
||||
assign banner_text = collection.metafields.custom.banner_texto.value | default: collection.metafields.custom.banner_text.value
|
||||
assign banner_text_is_html = false
|
||||
if banner_text == blank
|
||||
assign banner_text = collection.description
|
||||
assign banner_text_is_html = true
|
||||
if directory_text != blank
|
||||
assign banner_text = directory_text
|
||||
else
|
||||
assign banner_text = collection.description
|
||||
assign banner_text_is_html = true
|
||||
endif
|
||||
endif
|
||||
|
||||
assign grid_image = collection.metafields.custom.banner_listado.value | default: collection.metafields.custom.banner_grid.value
|
||||
@@ -91,16 +142,10 @@
|
||||
endif
|
||||
|
||||
assign current_sort = collection.sort_by | default: collection.default_sort_by
|
||||
assign sort_label = blank
|
||||
for option in collection.sort_options
|
||||
if option.value == current_sort
|
||||
assign sort_label = option.name
|
||||
endif
|
||||
endfor
|
||||
%}
|
||||
|
||||
<section
|
||||
class="collection full-width"
|
||||
class="collection full-width{% if collection.handle == 'all' %} collection--all{% endif %}"
|
||||
data-collection
|
||||
data-cart-add-url="{{ routes.cart_add_url }}.js"
|
||||
>
|
||||
@@ -111,6 +156,8 @@
|
||||
<img
|
||||
class="collection__banner-image"
|
||||
src="{{ banner_asset | asset_url }}"
|
||||
srcset="{{ banner_asset | replace: '.avif', '-sm.avif' | asset_url }} 800w, {{ banner_asset | asset_url }} 1920w"
|
||||
sizes="(max-width: 767px) 100vw, 50vw"
|
||||
alt="{{ banner_title | escape }}"
|
||||
width="1600"
|
||||
height="667"
|
||||
@@ -161,133 +208,18 @@
|
||||
{% endif %}
|
||||
|
||||
<div class="collection__body">
|
||||
<div class="collection__bar">
|
||||
<div class="collection__tools">
|
||||
<button class="collection__tool" type="button" data-filter-toggle aria-expanded="false" aria-controls="collection-filters">
|
||||
<svg width="25" height="25" viewBox="0 0 25 25" aria-hidden="true" focusable="false">
|
||||
<path d="M4 7.5h17M4 12.5h17M4 17.5h17" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/>
|
||||
<circle cx="9" cy="7.5" r="2.1" fill="#f9f9fa" stroke="currentColor" stroke-width="1.4"/>
|
||||
<circle cx="16" cy="12.5" r="2.1" fill="#f9f9fa" stroke="currentColor" stroke-width="1.4"/>
|
||||
<circle cx="11" cy="17.5" r="2.1" fill="#f9f9fa" stroke="currentColor" stroke-width="1.4"/>
|
||||
</svg>
|
||||
{{ 'collection_page.filters' | t }}
|
||||
</button>
|
||||
<button class="collection__tool" type="button" data-sort-toggle aria-expanded="false" aria-controls="collection-sort">
|
||||
{{ 'collection_page.sort' | t: sort: sort_label }}
|
||||
</button>
|
||||
</div>
|
||||
<p class="collection__count">{{ 'collection_page.products' | t: count: collection.products_count }}</p>
|
||||
</div>
|
||||
|
||||
<div class="collection__drawer" id="collection-filters" data-filter-panel aria-hidden="true">
|
||||
<button class="collection__drawer-backdrop" type="button" data-filter-close tabindex="-1" aria-label="{{ 'collection_page.close_filters' | t }}"></button>
|
||||
<div class="collection__drawer-panel" role="dialog" aria-modal="true" aria-labelledby="collection-filters-title">
|
||||
<div class="collection__drawer-head">
|
||||
<h2 id="collection-filters-title" class="collection__drawer-title">{{ 'collection_page.filters' | t }}</h2>
|
||||
<button class="collection__drawer-close" type="button" data-filter-close aria-label="{{ 'collection_page.close_filters' | t }}">
|
||||
<svg width="14" height="14" viewBox="0 0 14 14" aria-hidden="true" focusable="false">
|
||||
<path d="M2 2l10 10M12 2L2 12" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
{% if collection.filters.size > 0 %}
|
||||
<form class="collection__filter-form" action="{{ collection.url }}" method="get">
|
||||
{% if current_sort != blank %}
|
||||
<input type="hidden" name="sort_by" value="{{ current_sort }}">
|
||||
{% endif %}
|
||||
<div class="collection__filter-groups">
|
||||
{% for filter in collection.filters %}
|
||||
<fieldset class="collection__filter">
|
||||
<legend>{{ filter.label | escape }}</legend>
|
||||
{% case filter.type %}
|
||||
{% when 'price_range' %}
|
||||
<div class="collection__price">
|
||||
<input
|
||||
type="number"
|
||||
name="{{ filter.min_value.param_name }}"
|
||||
{% if filter.min_value.value %}value="{{ filter.min_value.value | divided_by: 100.0 }}"{% endif %}
|
||||
min="0"
|
||||
placeholder="0"
|
||||
>
|
||||
<input
|
||||
type="number"
|
||||
name="{{ filter.max_value.param_name }}"
|
||||
{% if filter.max_value.value %}value="{{ filter.max_value.value | divided_by: 100.0 }}"{% endif %}
|
||||
min="0"
|
||||
placeholder="{{ filter.range_max | divided_by: 100.0 }}"
|
||||
>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="collection__options">
|
||||
{% for value in filter.values %}
|
||||
<label class="collection__option">
|
||||
<input
|
||||
type="checkbox"
|
||||
name="{{ value.param_name }}"
|
||||
value="{{ value.value }}"
|
||||
{% if value.active %}checked{% endif %}
|
||||
{% if value.count == 0 and value.active == false %}disabled{% endif %}
|
||||
>
|
||||
<span>{{ value.label | escape }} ({{ value.count }})</span>
|
||||
</label>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endcase %}
|
||||
</fieldset>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="collection__filter-actions">
|
||||
<button class="collection__apply" type="submit">{{ 'collection_page.apply' | t }}</button>
|
||||
<a class="collection__clear" href="{{ collection.url }}">{{ 'collection_page.clear' | t }}</a>
|
||||
</div>
|
||||
</form>
|
||||
{% else %}
|
||||
<p class="collection__none">{{ 'collection_page.no_filters' | t }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="collection__drawer" id="collection-sort" data-sort-panel aria-hidden="true">
|
||||
<button class="collection__drawer-backdrop" type="button" data-sort-close tabindex="-1" aria-label="{{ 'collection_page.close_sort' | t }}"></button>
|
||||
<div class="collection__drawer-panel" role="dialog" aria-modal="true" aria-labelledby="collection-sort-title">
|
||||
<div class="collection__drawer-head">
|
||||
<h2 id="collection-sort-title" class="collection__drawer-title">{{ 'collection_page.sort_title' | t }}</h2>
|
||||
<button class="collection__drawer-close" type="button" data-sort-close aria-label="{{ 'collection_page.close_sort' | t }}">
|
||||
<svg width="14" height="14" viewBox="0 0 14 14" aria-hidden="true" focusable="false">
|
||||
<path d="M2 2l10 10M12 2L2 12" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<form class="collection__sort-form" action="{{ collection.url }}" method="get">
|
||||
{% for filter in collection.filters %}
|
||||
{% if filter.type == 'price_range' %}
|
||||
{% if filter.min_value.value %}
|
||||
<input type="hidden" name="{{ filter.min_value.param_name }}" value="{{ filter.min_value.value }}">
|
||||
{% endif %}
|
||||
{% if filter.max_value.value %}
|
||||
<input type="hidden" name="{{ filter.max_value.param_name }}" value="{{ filter.max_value.value }}">
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% for value in filter.active_values %}
|
||||
<input type="hidden" name="{{ value.param_name }}" value="{{ value.value }}">
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<div class="collection__sort-list">
|
||||
{% for option in collection.sort_options %}
|
||||
<button
|
||||
class="collection__sort-option{% if option.value == current_sort %} is-current{% endif %}"
|
||||
type="submit"
|
||||
name="sort_by"
|
||||
value="{{ option.value }}"
|
||||
>
|
||||
{{ option.name | escape }}
|
||||
</button>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{%- capture collection_count -%}{{ 'collection_page.products' | t: count: collection.products_count }}{%- endcapture -%}
|
||||
{% render 'facets-toolbar',
|
||||
filters: collection.filters,
|
||||
sort_options: collection.sort_options,
|
||||
current_sort: current_sort,
|
||||
action_url: collection.url,
|
||||
sort_action_url: request.path,
|
||||
clear_url: collection.url,
|
||||
tag_list: collection.all_tags,
|
||||
tag_base_url: collection.url,
|
||||
count_label: collection_count
|
||||
%}
|
||||
|
||||
{% paginate collection.products by per_page %}
|
||||
{% if collection.products_count == 0 %}
|
||||
@@ -318,7 +250,7 @@
|
||||
|
||||
{% for product in collection.products %}
|
||||
{% assign card_suffix = section.id | append: '-' | append: forloop.index %}
|
||||
{% render 'collection-card', product: product, form_suffix: card_suffix %}
|
||||
{% render 'collection-card', product: product, form_suffix: card_suffix, badge_mode: 'none' %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user