Ajustes antes de produccion

This commit is contained in:
2026-10-22 00:07:21 -06:00
parent f9666c4088
commit 1be9d16c83
124 changed files with 3540 additions and 772 deletions
+47 -3
View File
@@ -10,6 +10,20 @@
else
assign subheading = 'testimonials.subheading' | t
endif
assign visible_testimonials = 0
for block in section.blocks
assign slide_product = block.settings.product
assign skip_slide = false
if slide_product != blank
unless slide_product.available
assign skip_slide = true
endunless
endif
unless skip_slide
assign visible_testimonials = visible_testimonials | plus: 1
endunless
endfor
%}
<section
@@ -36,15 +50,28 @@
{% endif %}
</div>
{% if section.blocks.size > 0 %}
{% if visible_testimonials > 0 %}
<div class="testimonials__stage">
<div class="testimonials__copy">
{% assign shown_slides = 0 %}
{% for block in section.blocks %}
{% liquid
assign slide_product = block.settings.product
assign skip_slide = false
if slide_product != blank
unless slide_product.available
assign skip_slide = true
endunless
endif
%}
{% if skip_slide %}
{% continue %}
{% endif %}
<div
class="testimonials__slide"
data-slide
{{ block.shopify_attributes }}
{% unless forloop.first %}hidden{% endunless %}
{% if shown_slides > 0 %}hidden{% endif %}
>
<div class="testimonials__meta">
<div class="testimonials__stars" role="img" aria-label="{{ 'testimonials.rating' | t: rating: block.settings.rating }}">
@@ -64,6 +91,7 @@
<p class="testimonials__quote">{{ block.settings.quote | escape }}</p>
{% endif %}
</div>
{% assign shown_slides = shown_slides | plus: 1 %}
{% endfor %}
<div class="testimonials__nav">
@@ -85,7 +113,20 @@
</div>
<div class="testimonials__products">
{% assign shown_products = 0 %}
{% for block in section.blocks %}
{% liquid
assign slide_product = block.settings.product
assign skip_slide = false
if slide_product != blank
unless slide_product.available
assign skip_slide = true
endunless
endif
%}
{% if skip_slide %}
{% continue %}
{% endif %}
{% liquid
assign slide_product = block.settings.product
assign variant = blank
@@ -114,7 +155,7 @@
endif
endif
%}
<div class="testimonials__product" data-product {% unless forloop.first %}hidden{% endunless %}>
<div class="testimonials__product" data-product {% if shown_products > 0 %}hidden{% endif %}>
{% if slide_product != blank %}
<div class="testimonials__media">
<a class="testimonials__media-link" href="{{ slide_product.url }}">
@@ -189,6 +230,7 @@
</div>
{% endif %}
</div>
{% assign shown_products = shown_products | plus: 1 %}
{% endfor %}
</div>
</div>
@@ -264,6 +306,7 @@
if (!window.__seasonTestimonials) {
window.__seasonTestimonials = true;
document.addEventListener('submit', async (event) => {
if (event.defaultPrevented) return;
const form = event.target;
if (!(form instanceof HTMLFormElement) || !form.classList.contains('testimonials__form')) return;
const root = form.closest('[data-testimonials]');
@@ -288,6 +331,7 @@
window.location.href = root.dataset.checkoutUrl;
return;
}
document.dispatchEvent(new CustomEvent('season:cart:open'));
const cart = await fetch('/cart.js').then((result) => result.json());
setCartCount(cart.item_count);
} else if (data.description) {