Ajustes antes de produccion
|
After Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 73 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 8.0 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 14 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" role="img" viewBox="0 0 38 24" width="38" height="24" fill="none" aria-labelledby="pi-american_express"><title id="pi-american_express">American Express</title><rect x=".5" y=".5" width="37" height="23" rx="2.5" stroke="#000" stroke-opacity=".07" fill="none"/><path d="M35 0H3C1.3 0 0 1.3 0 3V21C0 22.7 1.4 24 3 24H35C36.7 24 38 22.7 38 21V3C38 1.3 36.6 0 35 0Z" fill="#0071CE" style="fill:#0071CE;fill:color(display-p3 0.0000 0.4431 0.8078);fill-opacity:1;"/><path d="M3 0.5H35C36.3348 0.5 37.5 1.58692 37.5 3V21C37.5 22.4239 36.4239 23.5 35 23.5H3C1.66524 23.5 0.5 22.4131 0.5 21V3C0.5 1.57614 1.57614 0.5 3 0.5Z" stroke="black" stroke-opacity="0.07" style="stroke:black;stroke-opacity:0.07;"/><path d="M25.8662 6.33203V3H31L31.8662 5.5332L32.7334 3H37V14.2002H36.7998L34.8672 16.2656L36.7998 18.3594H37V21.2666H33.5996L31.9336 19.3994L30.2002 21.2666H19.4668V12.666H16L20.2666 3H24.4004L25.8662 6.33203ZM20.5996 20.2656H27V18.5322H22.666V17.3994H26.8662V15.666H22.666V14.5322H27V12.7988H20.5996V20.2656ZM30.5332 16.5322L27 20.2656H29.5996L31.8662 17.8662L34.0664 20.2656H36.7324L33.1992 16.4658L36.7324 12.7988H34.1328L31.8662 15.1992L29.7324 12.7988H27L30.5332 16.5322ZM17.666 11.7324H19.9326L20.5332 10.1992H23.999L24.666 11.7324H26.999L23.666 4.19922H20.999L17.666 11.7324ZM33.5996 4.19922L31.9326 8.86621L30.1992 4.19922H27V11.666H29.0664V6.39941L31 11.666H32.7998L34.7324 6.39941V11.666H36.7324V4.13281L33.5996 4.19922ZM23.2656 8.46582H21.2656L22.2656 5.99902L23.2656 8.46582Z" fill="white" style="fill:white;fill-opacity:1;"/></svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
@@ -0,0 +1 @@
|
||||
<svg id="Capa_1" data-name="Capa 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 48 30"><defs><style>.cls-1,.cls-2{fill:#fff;}.cls-1,.cls-5{stroke:#606060;stroke-miterlimit:10;stroke-width:0.25px;}.cls-3{clip-path:url(#clip-path);}.cls-4{fill:#2fc0d8;}.cls-5{fill:none;}</style><clipPath id="clip-path"><rect class="cls-1" x="1" y="1" width="46" height="28" rx="5.67"/></clipPath></defs><title>Metodo de pago</title><rect class="cls-2" x="1" y="1" width="46" height="28" rx="5.67"/><g class="cls-3"><path class="cls-4" d="M46.06,33H2.94C-1.44,33-8,10.87-8,6.48h0A7.94,7.94,0,0,1-.06-1.46H43.06A7.94,7.94,0,0,1,51,6.48h0C51,10.87,50.44,33,46.06,33Z"/><path d="M43.85,13.71c-.42,0-1.38.15-1.66.19-.27-1.48-1-2.54-2.1-2.79-2.21-.5-4.44,2.48-6,8l1.14.31c1.47-5.27,3.39-7.39,4.57-7.12.54.12,1,.8,1.2,1.85-2.82.64-3.41,1.88-3.34,2.88a2.18,2.18,0,0,0,1.2,1.86,2.32,2.32,0,0,0,2.23-.07,2.29,2.29,0,0,0,1-1.76s.16-1.13.17-1.59a7.78,7.78,0,0,0-1.19.24c0,.31-.15,1.16-.15,1.16-.07.46-.13.73-.47.95a1.11,1.11,0,0,1-1.06,0,1,1,0,0,1-.55-.88c0-.69.75-1.25,2.25-1.61h0A27.37,27.37,0,0,1,44,14.89Z"/><path d="M30.36,12.59A2.45,2.45,0,1,0,32.8,15,2.45,2.45,0,0,0,30.36,12.59Zm0,3.84A1.39,1.39,0,1,1,31.74,15,1.39,1.39,0,0,1,30.36,16.43Z"/><rect x="15.66" y="10.39" width="1.17" height="6.92"/><path d="M7.66,12.68v.22A2.43,2.43,0,0,0,4,15a2.44,2.44,0,0,0,2.44,2.44,2.36,2.36,0,0,0,1.18-.31v.23H8.83V12.68ZM6.48,16.43A1.39,1.39,0,1,1,7.87,15,1.39,1.39,0,0,1,6.48,16.43Z"/><path d="M12.31,12.59a2.47,2.47,0,0,0-1.18.31v-.22H10v6.93h1.17V17.17a2.36,2.36,0,0,0,1.18.31,2.45,2.45,0,0,0,0-4.89Zm0,3.84A1.39,1.39,0,1,1,13.69,15,1.39,1.39,0,0,1,12.31,16.43Z"/><polygon points="27.64 12.66 23.37 12.66 23.37 13.64 25.84 13.64 23.28 17.41 27.53 17.41 27.53 16.43 25.09 16.43 27.64 12.66"/><path d="M21.38,12.68v.22A2.43,2.43,0,0,0,17.76,15a2.44,2.44,0,0,0,2.44,2.44,2.36,2.36,0,0,0,1.18-.31v.23h1.17V12.68ZM20.2,16.43A1.39,1.39,0,1,1,21.59,15,1.39,1.39,0,0,1,20.2,16.43Z"/></g><rect class="cls-5" x="1" y="1" width="46" height="28" rx="5.67"/></svg>
|
||||
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" role="img" viewBox="0 0 38 24" width="38" height="24" fill="none" aria-labelledby="pi-master"><title id="pi-master">Mastercard</title><rect x=".5" y=".5" width="37" height="23" rx="2.5" stroke="#000" stroke-opacity=".07" fill="none"/><path d="M35 0H3C1.3 0 0 1.3 0 3V21C0 22.7 1.4 24 3 24H35C36.7 24 38 22.7 38 21V3C38 1.3 36.6 0 35 0Z" fill="#1C1C1C" style="fill:#1C1C1C;fill:color(display-p3 0.1098 0.1098 0.1098);fill-opacity:1;"/><path d="M35 1C36.1 1 37 1.9 37 3V21C37 22.1 36.1 23 35 23H3C1.9 23 1 22.1 1 21V3C1 1.9 1.9 1 3 1H35Z" fill="#232323" style="fill:#232323;fill:color(display-p3 0.1373 0.1373 0.1373);fill-opacity:1;"/><path d="M14.6364 19.2727C18.8538 19.2727 22.2727 15.8538 22.2727 11.6364C22.2727 7.41892 18.8538 4 14.6364 4C10.4189 4 7 7.41892 7 11.6364C7 15.8538 10.4189 19.2727 14.6364 19.2727Z" fill="#EB001B" style="fill:#EB001B;fill:color(display-p3 0.9216 0.0000 0.1059);fill-opacity:1;"/><path d="M23.3637 19.2727C27.5811 19.2727 31 15.8538 31 11.6364C31 7.41892 27.5811 4 23.3637 4C19.1462 4 15.7273 7.41892 15.7273 11.6364C15.7273 15.8538 19.1462 19.2727 23.3637 19.2727Z" fill="#F79E1B" style="fill:#F79E1B;fill:color(display-p3 0.9686 0.6196 0.1059);fill-opacity:1;"/><path d="M22.2727 11.6362C22.2727 9.01797 20.9637 6.72706 19 5.41797C17.0364 6.83615 15.7273 9.12706 15.7273 11.6362C15.7273 14.1452 17.0364 16.5452 19 17.8543C20.9637 16.5452 22.2727 14.2543 22.2727 11.6362Z" fill="#FF5F00" style="fill:#FF5F00;fill:color(display-p3 1.0000 0.3725 0.0000);fill-opacity:1;"/></svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 7.3 KiB |
@@ -0,0 +1,9 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="38" height="24" viewBox="0 0 38 24" role="img" aria-labelledby="pi-paypal">
|
||||
<title id="pi-paypal">PayPal</title>
|
||||
<rect width="38" height="24" rx="3" fill="#fff"/>
|
||||
<rect x=".5" y=".5" width="37" height="23" rx="2.5" fill="none" stroke="#000" stroke-opacity=".12"/>
|
||||
<g transform="translate(4 8.4) scale(0.79)">
|
||||
<path fill="#253B80" d="M4.54.022c.973 0 1.706.269 2.12.777.376.463.5 1.124.37 1.966-.288 1.923-1.393 2.894-3.308 2.894h-.92a.41.41 0 0 0-.4.358l-.317 2.106a.41.41 0 0 1-.398.358H.299a.25.25 0 0 1-.24-.293L1.235.379a.41.41 0 0 1 .4-.357zm-1.282 1.69c-.119 0-.22.09-.24.213L2.71 3.966h.44c.77 0 1.567 0 1.726-1.093.058-.383.011-.661-.141-.848-.256-.314-.752-.314-1.277-.314zm6.539.989c.67 0 1.343.153 1.645.612l.096.147.063-.407a.25.25 0 0 1 .24-.215h1.39c.15 0 .262.14.239.293l-.752 4.992a.41.41 0 0 1-.4.358h-1.253c-.149 0-.263-.14-.24-.294l.063-.406c-.01.013-.697.835-1.927.835-.722 0-1.329-.218-1.753-.742-.462-.57-.651-1.386-.518-2.24C6.946 3.922 8.259 2.7 9.797 2.7Zm.33 1.546c-.793 0-1.435.578-1.56 1.403-.066.406.012.77.217 1.026.208.257.531.392.935.392.805 0 1.437-.559 1.571-1.392.06-.403-.023-.77-.235-1.031s-.534-.398-.929-.398Zm10.516-1.408h-1.399a.4.4 0 0 0-.334.186l-1.93 2.977-.817-2.861a.41.41 0 0 0-.388-.302H14.4c-.167 0-.283.171-.23.336l1.541 4.737-1.448 2.142c-.114.169 0 .4.197.4h1.397a.4.4 0 0 0 .332-.18l4.653-7.036c.111-.169-.003-.399-.199-.399"/>
|
||||
<path fill="#179BD7" d="M25.275.022c.973 0 1.706.269 2.118.777.376.463.502 1.124.371 1.966-.289 1.923-1.393 2.894-3.308 2.894h-.92a.41.41 0 0 0-.399.358l-.334 2.214a.29.29 0 0 1-.279.25h-1.491c-.148 0-.263-.14-.24-.293L21.97.379a.41.41 0 0 1 .398-.357zm-1.283 1.69c-.12 0-.22.09-.24.213l-.308 2.041h.439c.77 0 1.568 0 1.726-1.093.058-.383.012-.661-.14-.848-.256-.314-.752-.314-1.277-.314zm6.54.989c.671 0 1.343.153 1.644.612l.098.147.061-.407a.246.246 0 0 1 .24-.215h1.39c.15 0 .263.14.24.293l-.753 4.992a.41.41 0 0 1-.398.358H31.8c-.149 0-.262-.14-.24-.294l.062-.406a2.62 2.62 0 0 1-1.927.835c-.721 0-1.328-.218-1.752-.742-.463-.57-.65-1.386-.518-2.24.256-1.712 1.57-2.933 3.107-2.933m.33 1.546c-.793 0-1.435.578-1.561 1.403-.065.406.013.77.219 1.026.207.257.531.392.934.392.805 0 1.437-.559 1.57-1.392.062-.403-.022-.77-.235-1.031-.211-.26-.532-.398-.928-.398ZM35.606.236l-1.193 7.952c-.023.154.09.293.239.293h1.2a.41.41 0 0 0 .398-.357L37.427.315c.023-.154-.09-.293-.239-.293h-1.343a.25.25 0 0 0-.24.214Z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.4 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" role="img" viewBox="0 0 38 24" width="38" height="24" fill="none" aria-labelledby="pi-visa"><title id="pi-visa">Visa</title><rect x=".5" y=".5" width="37" height="23" rx="2.5" stroke="#000" stroke-opacity=".07" fill="none"/><path d="M35 0H3C1.3 0 0 1.3 0 3V21C0 22.7 1.4 24 3 24H35C36.7 24 38 22.7 38 21V3C38 1.3 36.6 0 35 0Z" fill="#142FBD" style="fill:#142FBD;fill:color(display-p3 0.0784 0.1843 0.7412);fill-opacity:1;"/><path d="M35 1C36.1 1 37 1.9 37 3V21C37 22.1 36.1 23 35 23H3C1.9 23 1 22.1 1 21V3C1 1.9 1.9 1 3 1H35Z" fill="#1532CB" style="fill:#1532CB;fill:color(display-p3 0.0824 0.1961 0.7961);fill-opacity:1;"/><path d="M29.5944 10.2167H29.2778C28.8556 11.2722 28.5389 11.8 28.2222 13.3833H30.2278C29.9111 11.8 29.9111 11.0611 29.5944 10.2167V10.2167ZM32.6556 16.4444H30.8611C30.7556 16.4444 30.7556 16.4444 30.65 16.3389L30.4389 15.3889L30.3333 15.1778H27.8C27.6944 15.1778 27.5889 15.1778 27.5889 15.3889L27.2722 16.3389C27.2722 16.4444 27.1667 16.4444 27.1667 16.4444H24.95L25.1611 15.9167L28.2222 8.73889C28.2222 8.21111 28.5389 8 29.0667 8H30.65C30.7556 8 30.8611 8 30.8611 8.21111L32.3389 15.0722C32.4444 15.4944 32.55 15.8111 32.55 16.2333C32.6556 16.3389 32.6556 16.3389 32.6556 16.4444V16.4444ZM18.5111 16.1278L18.9333 14.2278C19.0389 14.2278 19.1444 14.3333 19.1444 14.3333C19.8833 14.65 20.6222 14.8611 21.3611 14.7556C21.5722 14.7556 21.8889 14.65 22.1 14.5444C22.6278 14.3333 22.6278 13.8056 22.2056 13.3833C21.9944 13.1722 21.6778 13.0667 21.3611 12.8556C20.9389 12.6444 20.5167 12.4333 20.2 12.1167C18.9333 11.0611 19.3556 9.58333 20.0944 8.84444C20.7278 8.42222 21.0444 8 21.8889 8C23.1556 8 24.5278 8 25.1611 8.21111H25.2667C25.1611 8.84444 25.0556 9.37222 24.8444 10.0056C24.3167 9.79444 23.7889 9.58333 23.2611 9.58333C22.9444 9.58333 22.6278 9.58333 22.3111 9.68889C22.1 9.68889 21.9944 9.79444 21.8889 9.9C21.6778 10.1111 21.6778 10.4278 21.8889 10.6389L22.4167 11.0611C22.8389 11.2722 23.2611 11.4833 23.5778 11.6944C24.1056 12.0111 24.6333 12.5389 24.7389 13.1722C24.95 14.1222 24.6333 14.9667 23.7889 15.6C23.2611 16.0222 23.05 16.2333 22.3111 16.2333C20.8333 16.2333 19.6722 16.3389 18.7222 16.0222C18.6167 16.2333 18.6167 16.2333 18.5111 16.1278V16.1278ZM14.8167 16.4444C14.9222 15.7056 14.9222 15.7056 15.0278 15.3889C15.5556 13.0667 16.0833 10.6389 16.5056 8.31667C16.6111 8.10556 16.6111 8 16.8222 8H18.7222C18.5111 9.26667 18.3 10.2167 17.9833 11.3778C17.6667 12.9611 17.35 14.5444 16.9278 16.1278C16.9278 16.3389 16.8222 16.3389 16.6111 16.3389L14.8167 16.4444ZM5 8.21111C5 8.10556 5.21111 8 5.31667 8H8.90556C9.43333 8 9.85556 8.31667 9.96111 8.84444L10.9111 13.4889C10.9111 13.5944 10.9111 13.5944 11.0167 13.7C11.0167 13.5944 11.1222 13.5944 11.1222 13.5944L13.3389 8.21111C13.2333 8.10556 13.3389 8 13.4444 8H15.6611C15.6611 8.10556 15.6611 8.10556 15.5556 8.21111L12.2833 15.9167C12.1778 16.1278 12.1778 16.2333 12.0722 16.3389C11.9667 16.4444 11.7556 16.3389 11.5444 16.3389H9.96111C9.85556 16.3389 9.75 16.3389 9.75 16.1278L8.06111 9.58333C7.85 9.37222 7.53333 9.05556 7.11111 8.95C6.47778 8.63333 5.31667 8.42222 5.10556 8.42222L5 8.21111Z" fill="white" style="fill:white;fill-opacity:1;"/></svg>
|
||||
|
After Width: | Height: | Size: 3.1 KiB |
@@ -12,9 +12,9 @@
|
||||
|
||||
const presets = [
|
||||
{ y: 48, x: 0, scale: 1 },
|
||||
{ y: 28, x: 40, scale: 1 },
|
||||
{ y: 28, x: 0, scale: 1 },
|
||||
{ y: 32, x: 0, scale: 0.97 },
|
||||
{ y: 24, x: -36, scale: 1 },
|
||||
{ y: 24, x: 0, scale: 1 },
|
||||
];
|
||||
|
||||
const running = new WeakMap();
|
||||
|
||||
|
After Width: | Height: | Size: 61 KiB |
|
After Width: | Height: | Size: 85 KiB |
|
After Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 65 KiB |
@@ -1 +1,23 @@
|
||||
{"current":{}}
|
||||
/*
|
||||
* ------------------------------------------------------------
|
||||
* IMPORTANT: The contents of this file are auto-generated.
|
||||
*
|
||||
* This file may be updated by the Shopify admin theme editor
|
||||
* or related systems. Please exercise caution as any changes
|
||||
* made to this file may be overwritten.
|
||||
* ------------------------------------------------------------
|
||||
*/
|
||||
{
|
||||
"current": {
|
||||
"sections": {
|
||||
"cart-drawer": {
|
||||
"type": "cart-drawer",
|
||||
"settings": {
|
||||
"free_shipping": 699,
|
||||
"recommendations": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"content_for_index": []
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,6 +80,153 @@
|
||||
"label": "Meta descripción por defecto",
|
||||
"default": "Skincare mexicano con ingredientes naturales: protectores solares, sérums, hidratantes y limpiadores para cada tipo de piel. Encuentra tu rutina Seasons.",
|
||||
"info": "Se usa en páginas sin descripción propia (inicio, colecciones sin descripción). Máx. ~155 caracteres."
|
||||
},
|
||||
{
|
||||
"type": "header",
|
||||
"content": "Datos estructurados de producto (Google)"
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"id": "sd_ship_country",
|
||||
"label": "País de envío (ISO)",
|
||||
"default": "MX"
|
||||
},
|
||||
{
|
||||
"type": "number",
|
||||
"id": "sd_ship_cost",
|
||||
"label": "Costo de envío estándar",
|
||||
"default": 150,
|
||||
"info": "En la moneda de la tienda."
|
||||
},
|
||||
{
|
||||
"type": "number",
|
||||
"id": "sd_free_threshold",
|
||||
"label": "Envío gratis desde",
|
||||
"default": 699,
|
||||
"info": "0 para desactivar."
|
||||
},
|
||||
{
|
||||
"type": "number",
|
||||
"id": "sd_handling_min",
|
||||
"label": "Preparación mínima (días hábiles)",
|
||||
"default": 1
|
||||
},
|
||||
{
|
||||
"type": "number",
|
||||
"id": "sd_handling_max",
|
||||
"label": "Preparación máxima (días hábiles)",
|
||||
"default": 2
|
||||
},
|
||||
{
|
||||
"type": "number",
|
||||
"id": "sd_transit_min",
|
||||
"label": "Tránsito mínimo (días hábiles)",
|
||||
"default": 3
|
||||
},
|
||||
{
|
||||
"type": "number",
|
||||
"id": "sd_transit_max",
|
||||
"label": "Tránsito máximo (días hábiles)",
|
||||
"default": 5
|
||||
},
|
||||
{
|
||||
"type": "checkbox",
|
||||
"id": "sd_returns",
|
||||
"label": "Acepta cambios/devoluciones",
|
||||
"default": true
|
||||
},
|
||||
{
|
||||
"type": "number",
|
||||
"id": "sd_return_days",
|
||||
"label": "Días para solicitar cambio",
|
||||
"default": 5
|
||||
},
|
||||
{
|
||||
"type": "select",
|
||||
"id": "sd_refund_type",
|
||||
"label": "Tipo de reembolso",
|
||||
"default": "ExchangeRefund",
|
||||
"options": [
|
||||
{
|
||||
"value": "ExchangeRefund",
|
||||
"label": "Solo cambio de producto"
|
||||
},
|
||||
{
|
||||
"value": "FullRefund",
|
||||
"label": "Reembolso total"
|
||||
},
|
||||
{
|
||||
"value": "StoreCreditRefund",
|
||||
"label": "Crédito en tienda"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "select",
|
||||
"id": "sd_return_fees",
|
||||
"label": "Costo del envío de devolución",
|
||||
"default": "FreeReturn",
|
||||
"options": [
|
||||
{
|
||||
"value": "FreeReturn",
|
||||
"label": "Gratis (lo paga la tienda)"
|
||||
},
|
||||
{
|
||||
"value": "ReturnFeesCustomerResponsibility",
|
||||
"label": "Lo paga el cliente"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Google Customer Reviews",
|
||||
"settings": [
|
||||
{
|
||||
"type": "checkbox",
|
||||
"id": "gcr_badge_enabled",
|
||||
"label": "Mostrar insignia de Reseñas de Clientes en Google",
|
||||
"default": true
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"id": "gcr_merchant_id",
|
||||
"label": "ID de Merchant Center",
|
||||
"default": "464277577"
|
||||
},
|
||||
{
|
||||
"type": "select",
|
||||
"id": "gcr_badge_position",
|
||||
"label": "Posición de la insignia",
|
||||
"default": "BOTTOM_LEFT",
|
||||
"options": [
|
||||
{
|
||||
"value": "BOTTOM_LEFT",
|
||||
"label": "Abajo a la izquierda"
|
||||
},
|
||||
{
|
||||
"value": "BOTTOM_RIGHT",
|
||||
"label": "Abajo a la derecha"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"id": "gcr_region",
|
||||
"label": "Región (ISO)",
|
||||
"default": "MX"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Filtros",
|
||||
"settings": [
|
||||
{
|
||||
"type": "textarea",
|
||||
"id": "facets_hidden_tags",
|
||||
"label": "Etiquetas ocultas en filtros",
|
||||
"info": "Separadas por coma. Las etiquetas con guion bajo (_) se ocultan siempre.",
|
||||
"default": "bonsai_excluded, DESCONTINUAR, Exclude From Back In Stock, exclude_rebuy, exclude_recommendations, exclude_review, hidden, Hidden recommendation, Hide, judgeme_excluded, NO, nocart, not-on-sale, price-change-job-active, PRUEBA, SEARCHANISE_IGNORE, spo-default, spo-disabled, __hidden, Buen Fin, REGALO, TODO, OFERTAS, PRECIO ESPECIAL, Nuevos, NUEVA LÍNEA"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
<!doctype html>
|
||||
<html lang="{{ request.locale.iso_code }}" style="max-width:100%;overflow-x:clip">
|
||||
<head>
|
||||
<link rel="preconnect" href="https://cdn.shopify.com">
|
||||
{%- if template.name == 'index' -%}
|
||||
{%- # Hero cover (first frame of the theme-hosted video) = LCP image. Before the large inline CSS. -%}
|
||||
<link rel="preload" as="image" href="{{ 'hero-frame-mobile.avif' | asset_url }}" media="(max-width: 1023px)" fetchpriority="high">
|
||||
<link rel="preload" as="image" href="{{ 'hero-frame-desktop.avif' | asset_url }}" media="(min-width: 1024px)" fetchpriority="high">
|
||||
{%- endif -%}
|
||||
{% # Inlined CSS Variables %}
|
||||
{% render 'css-variables' %}
|
||||
|
||||
@@ -15,7 +21,6 @@
|
||||
{% render 'delay-header-scripts', html: shopify_header %}
|
||||
{% # WhatsApp coupon widget host: warm up the connection early %}
|
||||
{%- unless request.design_mode %}
|
||||
<link rel="preconnect" href="https://bpuemzaabpwmxvfcorjc.supabase.co" crossorigin>
|
||||
<link rel="dns-prefetch" href="https://bpuemzaabpwmxvfcorjc.supabase.co">
|
||||
{%- endunless %}
|
||||
</head>
|
||||
@@ -37,6 +42,9 @@
|
||||
<script type="rocketlazyloadscript" src="{{ 'anime.min.js' | asset_url }}" defer></script>
|
||||
<script type="rocketlazyloadscript" src="{{ 'scroll-motion.js' | asset_url }}" defer></script>
|
||||
{% endif %}
|
||||
{% render 'cart-merge-lines' %}
|
||||
{% render 'carousel-edge-arrows' %}
|
||||
{% render 'whatsapp-coupon-widget' %}
|
||||
{% render 'google-merchant-badge' %}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,12 +1,3 @@
|
||||
/*
|
||||
* ------------------------------------------------------------
|
||||
* IMPORTANT: The contents of this file are auto-generated.
|
||||
*
|
||||
* This file may be updated by the Shopify admin language editor
|
||||
* or related systems. Please exercise caution as any changes
|
||||
* made to this file may be overwritten.
|
||||
* ------------------------------------------------------------
|
||||
*/
|
||||
{
|
||||
"404": {
|
||||
"title": "404",
|
||||
@@ -124,7 +115,9 @@
|
||||
"empty": "Tu carrito está vacío",
|
||||
"remove": "Eliminar",
|
||||
"decrease": "Reducir cantidad",
|
||||
"increase": "Aumentar cantidad"
|
||||
"increase": "Aumentar cantidad",
|
||||
"subscription": "Suscripción",
|
||||
"one_time": "Compra única"
|
||||
},
|
||||
"customers": {
|
||||
"login": {
|
||||
@@ -139,7 +132,8 @@
|
||||
},
|
||||
"product_page": {
|
||||
"add": "Añadir a carrito",
|
||||
"buy": "Comprar ahora",
|
||||
"buy": "Comprar",
|
||||
"express": "Pago express",
|
||||
"favorite": "Favoritos",
|
||||
"options": "Opciones: {{ option }}",
|
||||
"description": "Descripción del producto",
|
||||
@@ -148,8 +142,9 @@
|
||||
"payments": "Métodos de pago",
|
||||
"payments_text": "Pago seguro con métodos confiables y cifrados. También puedes pagar a plazos con Mercado Pago, Kueski Pay o Aplazo.",
|
||||
"shipping": "Envío gratis desde $699 a todo México.",
|
||||
"payment": "Pago seguro métodos confiables y cifrados.",
|
||||
"payment": "Pago seguro",
|
||||
"installments": "Pago a plazos con Mercado Pago, Kueski Pay o Aplazo.",
|
||||
"installments_with": "Pago a plazos con",
|
||||
"guarantee": "Garantía de entrega reenvío sin costo si algo falla.",
|
||||
"routine": "Completa tu rutina",
|
||||
"also": "Llévate también",
|
||||
@@ -163,6 +158,11 @@
|
||||
"after": "Después",
|
||||
"reviewer": "Cliente",
|
||||
"gallery": "Imágenes del producto",
|
||||
"gallery_open": "Ver imagen en grande",
|
||||
"gallery_close": "Cerrar imagen",
|
||||
"gallery_prev": "Imagen anterior",
|
||||
"gallery_next": "Imagen siguiente",
|
||||
"gallery_count": "{{ current }} de {{ total }}",
|
||||
"write_review": "Escribir Reseña",
|
||||
"view_more": "Ver más",
|
||||
"review_name": "Nombre",
|
||||
@@ -222,6 +222,9 @@
|
||||
"search_placeholder": "Busca tu producto seasons favorito",
|
||||
"search_empty": "No hay productos para “{{ terms }}”",
|
||||
"search_view_all": "Ver todos los resultados",
|
||||
"search_sale": "Oferta",
|
||||
"search_sale_price": "Precio especial",
|
||||
"search_regular_price": "Precio regular",
|
||||
"search_status": {
|
||||
"one": "{{ count }} producto",
|
||||
"other": "{{ count }} productos"
|
||||
@@ -232,16 +235,23 @@
|
||||
"wishlist_empty": "Aún no tienes favoritos.",
|
||||
"wishlist_remove": "Quitar",
|
||||
"wishlist_close": "Cerrar favoritos",
|
||||
"wishlist_add": "Agregar",
|
||||
"wishlist_add_all": "Agregar todo al carrito",
|
||||
"wishlist_sold_out": "Agotado",
|
||||
"wishlist_suggest": "Te podría gustar",
|
||||
"wishlist_browse": "Ver productos",
|
||||
"cart_count": "Carrito, {{ count }} productos",
|
||||
"promo": "Cambia tu piel ¡hoy!",
|
||||
"submenu": "Abrir {{ menu_title }}",
|
||||
"submenu_next": "Ver más",
|
||||
"submenu_prev": "Ver anteriores",
|
||||
"links": {
|
||||
"categories": "Categorías",
|
||||
"routine": "Rutina",
|
||||
"skin_type": "Tipo de piel",
|
||||
"concern": "Preocupación",
|
||||
"sunscreen": "Protección Solar",
|
||||
"favorites": "Los favoritos",
|
||||
"favorites": "Tus favoritos",
|
||||
"kits": "Kits y Rutinas",
|
||||
"moisturizers": "Hidratantes",
|
||||
"glow_army": "Glow Army",
|
||||
@@ -362,7 +372,11 @@
|
||||
"subheading": "Descubre tips, rutinas y formas reales de usar tus productos favoritos.",
|
||||
"previous": "Anterior",
|
||||
"next": "Siguiente",
|
||||
"add_to_cart": "Agregar {{ product }} al carrito"
|
||||
"add_to_cart": "Agregar {{ product }} al carrito",
|
||||
"play_sound": "Reproducir video con sonido",
|
||||
"sound_on": "Activar sonido",
|
||||
"sound_off": "Silenciar",
|
||||
"tap_sound": "Toca para escuchar"
|
||||
},
|
||||
"distributors": {
|
||||
"line_1": "Lleva",
|
||||
@@ -467,5 +481,70 @@
|
||||
"dropper": "Aplicación de serum en el rostro",
|
||||
"cheek": "Crema aplicada en la mejilla"
|
||||
}
|
||||
},
|
||||
"category_directory": {
|
||||
"heading": "Categorías",
|
||||
"moisturizers_title": "Hidratantes",
|
||||
"moisturizers_text": "La hidratación es la base de una piel sana y luminosa. Descubre geles, cremas y emulsiones con activos como ácido hialurónico, niacinamida y algas marinas, en texturas ligeras que nutren sin sensación grasosa. Dermocosmética diseñada en México para acompañar tu rutina diaria.",
|
||||
"masks_title": "Mascarillas",
|
||||
"masks_text": "Dale a tu piel un momento extra de cuidado. Nuestras mascarillas faciales con té verde, avena y calabaza ayudan a nutrir, calmar y equilibrar según lo que tu piel necesita. Un ritual sencillo para consentirte en casa.",
|
||||
"sun_title": "Protección Solar",
|
||||
"sun_text": "Protectores solares FPS 50 para rostro y cuerpo con fórmulas ligeras y acabados para cada tipo de piel.",
|
||||
"cleansers_title": "Limpiadores",
|
||||
"cleansers_text": "Encuentra el limpiador facial ideal para tu tipo de piel. Nuestras fórmulas ayudan a eliminar impurezas, maquillaje, protector solar y exceso de grasa, dejando tu piel limpia, fresca y lista para continuar con tu rutina de cuidado facial.",
|
||||
"serum_title": "Sérum",
|
||||
"serum_text": "Los sérums concentran los activos que tu piel necesita en fórmulas ligeras de rápida absorción. Explora sueros faciales con vitamina C, niacinamida, ácido hialurónico y retinol para hidratar, iluminar y cuidar tu piel paso a paso.",
|
||||
"treat_title": "Paso 2. Trata",
|
||||
"treat_text": "El paso que hace la diferencia. Descubre tratamientos con activos específicos para complementar tu rutina y cuidar tu piel según sus necesidades.",
|
||||
"clean_title": "Paso 1. Limpia",
|
||||
"clean_text": "El primer paso hacia una piel saludable comienza aquí. Nuestros limpiadores faciales eliminan impurezas, maquillaje y exceso de grasa mientras respetan el equilibrio natural de tu piel.",
|
||||
"hydrate_step_title": "Paso 3. Hidrata",
|
||||
"hydrate_step_text": "Hidrata y fortalece tu piel con fórmulas ligeras que ayudan a mantener su equilibrio.",
|
||||
"protect_title": "Paso 4. Protege",
|
||||
"protect_text": "Protección diaria para rostro y cuerpo. Texturas ligeras, hidratación y acabados para cada tipo de piel.",
|
||||
"acne_title": "Acné",
|
||||
"acne_text": "Cuida la piel con tendencia al acné con fórmulas que ayudan a controlar el exceso de grasa, reducir imperfecciones y mantener una piel equilibrada y saludable.",
|
||||
"aging_title": "Antiedad",
|
||||
"aging_text": "Descubre tratamientos antiedad con PDRN, Exosomas, Vitamina C y otros ingredientes que ayudan a mejorar la firmeza, luminosidad e hidratación de tu piel.",
|
||||
"oil_title": "Control Grasa",
|
||||
"oil_text": "Descubre tratamientos seborreguladores con Niacinamida, Nopal, Ácido Salicílico y otros ingredientes que ayudan a controlar el exceso de brillo, purificar los poros y mantener la hidratación natural de tu piel.",
|
||||
"hydration_title": "Hidratación",
|
||||
"hydration_text": "Hidrata, calma y devuelve el glow natural a tu piel con fórmulas ligeras y efectivas. 🌿 Ideal para todo tipo de piel.",
|
||||
"spots_title": "Productos para aclarar la piel",
|
||||
"spots_text": "Trabaja hacia un tono más uniforme y luminoso. Nuestras fórmulas despigmentantes con vitamina C, niacinamida y ácido kójico ayudan a atenuar la apariencia de manchas e iluminar la piel de forma gradual.",
|
||||
"oily_title": "Piel Grasa",
|
||||
"oily_text": "Descubre productos diseñados para equilibrar la piel grasa, controlar el exceso de brillo y reducir imperfecciones sin resecar. Fórmulas ligeras que purifican y matifican tu rostro.",
|
||||
"combination_title": "Piel Mixta-Grasa",
|
||||
"combination_text": "Si tu piel brilla en la zona T y buscas equilibrio, esta selección es para ti. Limpiadores, hidratantes y protectores solares con texturas ligeras y activos como niacinamida y ácido salicílico que ayudan a controlar el exceso de grasa sin resecar.",
|
||||
"dry_title": "Piel Seca",
|
||||
"dry_text": "La piel seca pide hidratación y confort. Descubre cremas, geles y sérums con ácido hialurónico, vitamina C y algas marinas que ayudan a nutrir en profundidad, calmar la sensación de tirantez y devolver luminosidad."
|
||||
},
|
||||
"facets": {
|
||||
"price_from": "Precio desde",
|
||||
"price_to": "Precio hasta",
|
||||
"sort": {
|
||||
"manual": "Destacados",
|
||||
"relevance": "Más relevantes",
|
||||
"best_selling": "Más vendidos",
|
||||
"title_ascending": "Alfabético, A-Z",
|
||||
"title_descending": "Alfabético, Z-A",
|
||||
"price_ascending": "Precio, menor a mayor",
|
||||
"price_descending": "Precio, mayor a menor",
|
||||
"created_ascending": "Fecha, más antiguo primero",
|
||||
"created_descending": "Fecha, más reciente primero"
|
||||
},
|
||||
"labels": {
|
||||
"availability": "Disponibilidad",
|
||||
"in_stock": "Disponible",
|
||||
"out_of_stock": "Agotado",
|
||||
"price": "Precio",
|
||||
"product_type": "Tipo de producto",
|
||||
"brand": "Marca",
|
||||
"size": "Tamaño",
|
||||
"color": "Color",
|
||||
"tags": "Etiquetas",
|
||||
"category": "Categoría",
|
||||
"collection": "Colección"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,11 @@
|
||||
endif
|
||||
endif
|
||||
|
||||
if 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'
|
||||
@@ -71,7 +75,7 @@
|
||||
<{{ promo_tag }}
|
||||
class="bestsellers__promo"
|
||||
{% if promo_tag == 'a' %}
|
||||
href="{{ section.settings.promo_link }}"
|
||||
href="{{ promo_href }}"
|
||||
{% endif %}
|
||||
>
|
||||
{% if section.settings.promo_image != blank %}
|
||||
@@ -103,11 +107,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>
|
||||
@@ -164,7 +176,8 @@
|
||||
}
|
||||
|
||||
badge.textContent = String(count);
|
||||
link.setAttribute('aria-label', link.getAttribute('aria-label').replace(/\d+/, String(count)));
|
||||
const label = link.getAttribute('aria-label');
|
||||
if (label) link.setAttribute('aria-label', label.replace(/\d+/, String(count)));
|
||||
};
|
||||
|
||||
const updateArrows = (root) => {
|
||||
@@ -201,6 +214,28 @@
|
||||
root._bestsellersTimer = null;
|
||||
};
|
||||
|
||||
const mobileSlider = () => window.matchMedia('(max-width: 767px)').matches;
|
||||
|
||||
const slideStride = (viewport) => {
|
||||
const card = viewport.querySelector('.bestsellers__card');
|
||||
if (!card) return 0;
|
||||
const track = viewport.querySelector('[data-track]');
|
||||
const gap = track ? parseFloat(window.getComputedStyle(track).columnGap) || 0 : 0;
|
||||
return card.getBoundingClientRect().width + gap;
|
||||
};
|
||||
|
||||
const centerSlide = (viewport, index, behavior) => {
|
||||
const stride = slideStride(viewport);
|
||||
const count = viewport.querySelectorAll('.bestsellers__card').length;
|
||||
if (!stride || !count) return;
|
||||
const wrapped = ((index % count) + count) % count;
|
||||
const max = viewport.scrollWidth - viewport.clientWidth;
|
||||
viewport.scrollTo({
|
||||
left: Math.min(Math.max(wrapped * stride, 0), max),
|
||||
behavior,
|
||||
});
|
||||
};
|
||||
|
||||
const startAutoplay = (root) => {
|
||||
pauseAutoplay(root);
|
||||
if (reduceMotion.matches || root.dataset.paused === 'true') return;
|
||||
@@ -211,6 +246,16 @@
|
||||
const max = viewport.scrollWidth - viewport.clientWidth;
|
||||
if (max <= 2) return;
|
||||
|
||||
if (mobileSlider()) {
|
||||
const stride = slideStride(viewport);
|
||||
const count = viewport.querySelectorAll('.bestsellers__card').length;
|
||||
if (!stride || count < 2) return;
|
||||
const index = Math.round(viewport.scrollLeft / stride);
|
||||
const reduce = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
||||
centerSlide(viewport, index + 1 >= count ? 0 : index + 1, reduce ? 'auto' : 'smooth');
|
||||
return;
|
||||
}
|
||||
|
||||
if (viewport.scrollLeft >= max - 2) {
|
||||
viewport.scrollTo({ left: 0, behavior: 'smooth' });
|
||||
return;
|
||||
@@ -248,7 +293,10 @@
|
||||
const html = await response.text();
|
||||
const parsed = new DOMParser().parseFromString(html, 'text/html');
|
||||
const limit = Number(root.dataset.limit) || 8;
|
||||
const cards = Array.from(parsed.querySelectorAll('.bestsellers__card')).slice(0, limit);
|
||||
const cards = Array.from(parsed.querySelectorAll('.bestsellers__card')).filter((card) => {
|
||||
const button = card.querySelector('button[type="submit"]');
|
||||
return !button || !button.disabled;
|
||||
}).slice(0, limit);
|
||||
const track = root.querySelector('[data-track]');
|
||||
if (!track || !cards.length) {
|
||||
root.dataset.sorted = 'true';
|
||||
@@ -257,6 +305,8 @@
|
||||
|
||||
track.replaceChildren(...cards.map((card) => document.importNode(card, true)));
|
||||
applyWishlist(root);
|
||||
const loadedViewport = root.querySelector('[data-viewport]');
|
||||
if (loadedViewport && mobileSlider()) centerSlide(loadedViewport, 0, 'auto');
|
||||
updateArrows(root);
|
||||
root.dataset.sorted = 'true';
|
||||
startAutoplay(root);
|
||||
@@ -273,9 +323,17 @@
|
||||
if (!viewport) return;
|
||||
|
||||
applyWishlist(root);
|
||||
if (mobileSlider()) centerSlide(viewport, 0, 'auto');
|
||||
updateArrows(root);
|
||||
viewport.addEventListener('scroll', () => updateArrows(root), { passive: true });
|
||||
window.addEventListener('resize', () => updateArrows(root));
|
||||
window.addEventListener('resize', () => {
|
||||
if (mobileSlider()) {
|
||||
const stride = slideStride(viewport);
|
||||
const index = stride ? Math.round(viewport.scrollLeft / stride) : 0;
|
||||
centerSlide(viewport, index, 'auto');
|
||||
}
|
||||
updateArrows(root);
|
||||
});
|
||||
|
||||
root.addEventListener('mouseenter', () => {
|
||||
root.dataset.paused = 'true';
|
||||
@@ -369,6 +427,7 @@
|
||||
});
|
||||
|
||||
document.addEventListener('submit', async (event) => {
|
||||
if (event.defaultPrevented) return;
|
||||
const form = event.target;
|
||||
if (!(form instanceof HTMLFormElement) || !form.classList.contains('bestsellers__form')) return;
|
||||
|
||||
@@ -409,10 +468,10 @@
|
||||
return;
|
||||
}
|
||||
|
||||
document.dispatchEvent(new CustomEvent('season:cart:open'));
|
||||
const cartResponse = await fetch(root.dataset.cartUrl, { headers: { Accept: 'application/json' } });
|
||||
const cart = await cartResponse.json();
|
||||
if (typeof cart.item_count === 'number') setCartCount(cart.item_count);
|
||||
document.dispatchEvent(new CustomEvent('season:cart:open'));
|
||||
} catch (error) {
|
||||
form.submit();
|
||||
} finally {
|
||||
|
||||
@@ -100,31 +100,7 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{% if threshold > 0 %}
|
||||
<div class="cart-drawer__shipping">
|
||||
<p>
|
||||
{% if unlocked %}
|
||||
{{ 'cart_drawer.unlocked' | t }}
|
||||
{% else %}
|
||||
{{ 'cart_drawer.remaining_before' | t }}
|
||||
{{ remaining | money_without_trailing_zeros }}
|
||||
{{ 'cart_drawer.remaining_after' | t }}
|
||||
<span>{{ 'cart_drawer.free' | t }}</span>
|
||||
{% endif %}
|
||||
</p>
|
||||
<div
|
||||
class="cart-drawer__bar"
|
||||
style="--progress: {{ progress }}%;"
|
||||
role="progressbar"
|
||||
aria-valuemin="0"
|
||||
aria-valuemax="100"
|
||||
aria-valuenow="{{ progress }}"
|
||||
aria-label="{{ 'cart_drawer.shipping_progress' | t }}"
|
||||
>
|
||||
<span class="cart-drawer__bar-fill"></span>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
<div class="cart-drawer__items">
|
||||
{% if cart.item_count == 0 %}
|
||||
@@ -142,7 +118,7 @@
|
||||
{% unless item.variant.title == 'Default Title' %}
|
||||
<p class="cart-drawer__variant">{{ item.variant.title }}</p>
|
||||
{% endunless %}
|
||||
<p class="cart-drawer__price">{{ item.final_line_price | money_without_trailing_zeros }}</p>
|
||||
<p class="cart-drawer__price">{{ item.final_line_price | money_without_trailing_zeros }}{% render 'line-purchase-type', item: item %}</p>
|
||||
<div class="cart-drawer__qty">
|
||||
<button
|
||||
type="button"
|
||||
@@ -329,6 +305,8 @@
|
||||
const refresh = async (shouldOpen) => {
|
||||
const drawer = getDrawer();
|
||||
if (!drawer) return;
|
||||
// Combine duplicate lines of the same product/purchase type before rendering.
|
||||
if (window.seasonsMergeCartLines) await window.seasonsMergeCartLines();
|
||||
const currentId = ++requestId;
|
||||
|
||||
try {
|
||||
@@ -414,10 +392,33 @@
|
||||
const key = qtyButton.dataset.lineKey;
|
||||
const quantity = Number(qtyButton.dataset.quantity);
|
||||
if (!key || Number.isNaN(quantity)) return;
|
||||
// Optimistic UI: collapse the line right away instead of waiting for Shopify.
|
||||
const line = qtyButton.closest('.cart-drawer__line');
|
||||
if (quantity === 0 && line) line.classList.add('is-removing');
|
||||
drawer.classList.add('is-busy');
|
||||
try {
|
||||
const ok = await postJson(drawer.dataset.changeUrl, { id: key, quantity });
|
||||
if (ok) await refresh(false);
|
||||
// One round trip: change the line and get the re-rendered drawer (bundled section rendering).
|
||||
const sectionId = drawer.dataset.sectionId;
|
||||
const response = await fetch(drawer.dataset.changeUrl, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json', Accept: 'application/json' },
|
||||
body: JSON.stringify({ id: key, quantity, sections: sectionId, sections_url: window.location.pathname }),
|
||||
});
|
||||
if (!response.ok) throw new Error('change failed');
|
||||
const data = await response.json();
|
||||
const html = data.sections && data.sections[sectionId];
|
||||
const fresh = html ? new DOMParser().parseFromString(html, 'text/html').querySelector('[data-cart-drawer-content]') : null;
|
||||
const current = getDrawer()?.querySelector('[data-cart-drawer-content]');
|
||||
if (fresh && current) {
|
||||
++requestId;
|
||||
current.replaceWith(fresh);
|
||||
setCount(Number(fresh.dataset.itemCount || '0'));
|
||||
} else {
|
||||
await refresh(false);
|
||||
}
|
||||
} catch (error) {
|
||||
line?.classList.remove('is-removing');
|
||||
await refresh(false);
|
||||
} finally {
|
||||
getDrawer()?.classList.remove('is-busy');
|
||||
}
|
||||
@@ -430,6 +431,8 @@
|
||||
if (!(form instanceof HTMLFormElement)) return;
|
||||
const action = form.getAttribute('action') || '';
|
||||
if (!action.includes('/cart/add')) return;
|
||||
// Forms with their own add-to-cart handler open the drawer themselves (season:cart:open).
|
||||
if (form.matches('.hero__form, .learn__form, .testimonials__form, .bestsellers__form, [data-collection-card]')) return;
|
||||
if (event.submitter && event.submitter.closest('.shopify-payment-button')) return;
|
||||
if (event.submitter && event.submitter.hasAttribute('data-buy')) return;
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
{% if item.original_line_price > item.final_line_price %}
|
||||
<s>{{ item.original_line_price | money_without_trailing_zeros }}</s>
|
||||
{% endif %}
|
||||
</p>
|
||||
{% render 'line-purchase-type', item: item %}</p>
|
||||
<div class="cart-page__qty">
|
||||
{% if item.quantity > 1 %}
|
||||
<a
|
||||
@@ -83,32 +83,7 @@
|
||||
</div>
|
||||
|
||||
<aside class="cart-page__summary">
|
||||
{% if threshold > 0 %}
|
||||
<div class="cart-page__shipping">
|
||||
<p>
|
||||
{% if unlocked %}
|
||||
{{ 'cart_drawer.unlocked' | t }}
|
||||
{% else %}
|
||||
{{ 'cart_drawer.remaining_before' | t }}
|
||||
{{ remaining | money_without_trailing_zeros }}
|
||||
{{ 'cart_drawer.remaining_after' | t }}
|
||||
<span>{{ 'cart_drawer.free' | t }}</span>
|
||||
{% endif %}
|
||||
</p>
|
||||
<div
|
||||
class="cart-page__bar"
|
||||
style="--progress: {{ progress }}%;"
|
||||
role="progressbar"
|
||||
aria-valuemin="0"
|
||||
aria-valuemax="100"
|
||||
aria-valuenow="{{ progress }}"
|
||||
aria-label="{{ 'cart_drawer.shipping_progress' | t }}"
|
||||
>
|
||||
<span class="cart-page__bar-fill"></span>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
<p class="cart-page__subtotal">
|
||||
<span>{{ 'cart_drawer.subtotal' | t }}</span>
|
||||
<strong>{{ cart.total_price | money_without_trailing_zeros }}</strong>
|
||||
|
||||
@@ -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 %}
|
||||
|
||||
@@ -1,40 +1,44 @@
|
||||
{% comment %}
|
||||
This section is used in the list-collections template to render a list of
|
||||
collections.
|
||||
|
||||
https://shopify.dev/docs/storefronts/themes/architecture/templates/collection
|
||||
Category directory used by the list-collections template.
|
||||
{% endcomment %}
|
||||
|
||||
<h1>{{ 'collections.title' | t }}</h1>
|
||||
<section class="category-directory full-width">
|
||||
<h1 class="category-directory__title">{{ 'category_directory.heading' | t }}</h1>
|
||||
|
||||
<div
|
||||
class="collections {{ section.settings.grid_item_width }}"
|
||||
style="--grid-gap: {{ section.settings.grid_gap }}px"
|
||||
>
|
||||
{% for collection in collections %}
|
||||
<a class="collection-card" href="{{ collection.url }}">
|
||||
{% if collection.featured_image %}
|
||||
{% render 'image',
|
||||
class: 'collection-card__image',
|
||||
image: collection.featured_image,
|
||||
width: 600,
|
||||
height: 600,
|
||||
crop: 'center'
|
||||
%}
|
||||
{% endif %}
|
||||
{% capture category_cards %}
|
||||
banner-limpia.avif|/collections/1-limpia|{{ 'category_directory.clean_title' | t }}|{{ 'category_directory.clean_text' | t }}
|
||||
---banner-trata.avif|/collections/2-trata|{{ 'category_directory.treat_title' | t }}|{{ 'category_directory.treat_text' | t }}
|
||||
---banner-hidrata.avif|/collections/3-hidrata|{{ 'category_directory.hydrate_step_title' | t }}|{{ 'category_directory.hydrate_step_text' | t }}
|
||||
---banner-protectores.avif|/collections/4-protege-bloqueadores-solares|{{ 'category_directory.protect_title' | t }}|{{ 'category_directory.protect_text' | t }}
|
||||
---banner-hidratantes.avif|/collections/hidratantes|{{ 'category_directory.moisturizers_title' | t }}|{{ 'category_directory.moisturizers_text' | t }}
|
||||
---banner-mascarillas.avif|/collections/mascarillas|{{ 'category_directory.masks_title' | t }}|{{ 'category_directory.masks_text' | t }}
|
||||
---banner-proteccion-solar.avif|/collections/proteccion-solar-1|{{ 'category_directory.sun_title' | t }}|{{ 'category_directory.sun_text' | t }}
|
||||
---banner-limpiadores.avif|/collections/limpiadores|{{ 'category_directory.cleansers_title' | t }}|{{ 'category_directory.cleansers_text' | t }}
|
||||
---banner-serums.avif|/collections/serum|{{ 'category_directory.serum_title' | t }}|{{ 'category_directory.serum_text' | t }}
|
||||
---banner-preocupacion-acne.avif|/collections/acne-1|{{ 'category_directory.acne_title' | t }}|{{ 'category_directory.acne_text' | t }}
|
||||
---banner-antiedad.avif|/collections/antiedad-1|{{ 'category_directory.aging_title' | t }}|{{ 'category_directory.aging_text' | t }}
|
||||
---banner-control-grasa.avif|/collections/control-grasa|{{ 'category_directory.oil_title' | t }}|{{ 'category_directory.oil_text' | t }}
|
||||
---banner-preocupacion-hidratacion.avif|/collections/hidratacion|{{ 'category_directory.hydration_title' | t }}|{{ 'category_directory.hydration_text' | t }}
|
||||
---banner-preocupacion-solar.avif|/collections/proteccion-solar-1|{{ 'category_directory.sun_title' | t }}|{{ 'category_directory.sun_text' | t }}
|
||||
---banner-manchas.avif|/collections/aclarar|{{ 'category_directory.spots_title' | t }}|{{ 'category_directory.spots_text' | t }}
|
||||
---banner-piel-grasa.avif|/collections/piel-grasa|{{ 'category_directory.oily_title' | t }}|{{ 'category_directory.oily_text' | t }}
|
||||
---banner-piel-mixta-grasa.avif|/collections/piel-mixta-grasa|{{ 'category_directory.combination_title' | t }}|{{ 'category_directory.combination_text' | t }}
|
||||
---banner-piel-seca.avif|/collections/piel-seca-1|{{ 'category_directory.dry_title' | t }}|{{ 'category_directory.dry_text' | t }}
|
||||
{% endcapture %}
|
||||
|
||||
<div class="collection-card__content">
|
||||
<p>{{ collection.title }}</p>
|
||||
|
||||
{% if collection.description %}
|
||||
<p>{{ collection.description | strip_html | truncatewords: 15 }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</a>
|
||||
{% assign category_rows = category_cards | split: '---' %}
|
||||
{% for category_row in category_rows %}
|
||||
{% assign category_parts = category_row | strip | split: '|' %}
|
||||
{% if category_parts.size > 3 %}
|
||||
{% render 'category-card',
|
||||
image: category_parts[0],
|
||||
url: category_parts[1],
|
||||
title: category_parts[2],
|
||||
text: category_parts[3]
|
||||
%}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
|
||||
</section>
|
||||
|
||||
{% schema %}
|
||||
{
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
/*
|
||||
* ------------------------------------------------------------
|
||||
* IMPORTANT: The contents of this file are auto-generated.
|
||||
*
|
||||
* This file may be updated by the Shopify admin theme editor
|
||||
* or related systems. Please exercise caution as any changes
|
||||
* made to this file may be overwritten.
|
||||
* ------------------------------------------------------------
|
||||
*/
|
||||
{
|
||||
"type": "footer",
|
||||
"name": "t:general.footer",
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
/*
|
||||
* ------------------------------------------------------------
|
||||
* IMPORTANT: The contents of this file are auto-generated.
|
||||
*
|
||||
* This file may be updated by the Shopify admin theme editor
|
||||
* or related systems. Please exercise caution as any changes
|
||||
* made to this file may be overwritten.
|
||||
* ------------------------------------------------------------
|
||||
*/
|
||||
{
|
||||
"type": "header",
|
||||
"name": "t:general.header",
|
||||
|
||||
@@ -239,7 +239,7 @@
|
||||
if pill_title == favorites_label
|
||||
assign open_wishlist = true
|
||||
endif
|
||||
if pill_handle == 'los-favoritos'
|
||||
if pill_handle == 'los-favoritos' or pill_handle == 'tus-favoritos' or pill_handle == 'favoritos'
|
||||
assign open_wishlist = true
|
||||
endif
|
||||
%}
|
||||
@@ -253,7 +253,7 @@
|
||||
aria-expanded="false"
|
||||
aria-haspopup="dialog"
|
||||
>
|
||||
{{ link.title }}
|
||||
{{ 'header.links.favorites' | t }}
|
||||
</button>
|
||||
{% else %}
|
||||
<a
|
||||
@@ -300,16 +300,20 @@
|
||||
</div>
|
||||
|
||||
{% if promo_text != blank %}
|
||||
{% liquid
|
||||
assign promo_url = section.settings.promo_link
|
||||
if promo_url == blank
|
||||
if routes.root_url == '/'
|
||||
assign promo_url = '/collections/all-products'
|
||||
else
|
||||
assign promo_url = routes.root_url | append: '/collections/all-products'
|
||||
endif
|
||||
endif
|
||||
%}
|
||||
<div class="header__promo flex h-[50px] items-center justify-center bg-brand-mint px-4 text-center">
|
||||
{% if section.settings.promo_link != blank %}
|
||||
<a class="text-[20px] font-bold uppercase leading-none text-black no-underline xl:text-[14px]" href="{{ section.settings.promo_link }}">
|
||||
{{ promo_text }}
|
||||
</a>
|
||||
{% else %}
|
||||
<p class="m-0 text-[20px] font-bold uppercase leading-none xl:text-[14px]">
|
||||
{{ promo_text }}
|
||||
</p>
|
||||
{% endif %}
|
||||
<a class="text-[20px] font-bold uppercase leading-none text-black no-underline xl:text-[14px]" href="{{ promo_url }}">
|
||||
{{ promo_text }}
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -322,7 +326,7 @@
|
||||
></button>
|
||||
</header>
|
||||
|
||||
<div id="wish-drawer" class="wish-drawer" data-wish-drawer data-empty="{{ 'header.wishlist_empty' | t | escape }}" data-remove="{{ 'header.wishlist_remove' | t | escape }}" aria-hidden="true">
|
||||
<div id="wish-drawer" class="wish-drawer" data-wish-drawer data-empty="{{ 'header.wishlist_empty' | t | escape }}" data-remove="{{ 'header.wishlist_remove' | t | escape }}" data-add="{{ 'header.wishlist_add' | t | escape }}" data-sold-out="{{ 'header.wishlist_sold_out' | t | escape }}" data-cart-add-url="{{ routes.cart_add_url }}.js" aria-hidden="true" inert>
|
||||
<button class="wish-drawer__backdrop" type="button" data-wish-close tabindex="-1" aria-label="{{ 'header.wishlist_close' | t }}"></button>
|
||||
<div class="wish-drawer__panel" role="dialog" aria-modal="true" aria-labelledby="wish-drawer-title">
|
||||
<div class="wish-drawer__head">
|
||||
@@ -333,7 +337,46 @@
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div class="wish-drawer__list" data-wish-list></div>
|
||||
<div class="wish-drawer__scroll">
|
||||
<div class="wish-drawer__list" data-wish-list></div>
|
||||
{%- liquid
|
||||
assign wish_suggest = section.settings.wishlist_suggestions
|
||||
if wish_suggest == blank
|
||||
assign wish_suggest = collections['los-mas-vendidos']
|
||||
endif
|
||||
if wish_suggest == blank or wish_suggest.products_count == 0
|
||||
assign wish_suggest = collections.all
|
||||
endif
|
||||
-%}
|
||||
<div class="wish-drawer__suggest" data-wish-suggest hidden>
|
||||
<p class="wish-drawer__suggest-title">{{ 'header.wishlist_suggest' | t }}</p>
|
||||
<div class="wish-drawer__suggest-list">
|
||||
{%- assign wish_shown = 0 -%}
|
||||
{%- for sp in wish_suggest.products limit: 12 -%}
|
||||
{%- if wish_shown >= 4 -%}{%- break -%}{%- endif -%}
|
||||
{%- if sp.available -%}
|
||||
{%- assign wish_shown = wish_shown | plus: 1 -%}
|
||||
<article class="wish-drawer__item">
|
||||
<a class="wish-drawer__thumb" href="{{ sp.url }}">
|
||||
{%- if sp.featured_image -%}{{ sp.featured_image | image_url: width: 160 | image_tag: width: 72, height: 72, loading: 'lazy', alt: '' }}{%- endif -%}
|
||||
</a>
|
||||
<div>
|
||||
<a class="wish-drawer__name" href="{{ sp.url }}">{{ sp.title }}</a>
|
||||
<p class="wish-drawer__price">{{ sp.price | money_without_trailing_zeros }}</p>
|
||||
</div>
|
||||
<div class="wish-drawer__actions">
|
||||
<button class="wish-drawer__add" type="button" data-wish-add="{{ sp.selected_or_first_available_variant.id }}">{{ 'header.wishlist_add' | t }}</button>
|
||||
</div>
|
||||
</article>
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
</div>
|
||||
<a class="wish-drawer__browse" href="{{ wish_suggest.url | default: routes.all_products_collection_url }}">{{ 'header.wishlist_browse' | t }}</a>
|
||||
</div>
|
||||
<div class="wish-drawer__foot" data-wish-foot hidden>
|
||||
<button class="wish-drawer__add wish-drawer__add--all" type="button" data-wish-add-all>{{ 'header.wishlist_add_all' | t }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -346,15 +389,55 @@
|
||||
|
||||
const mobileQuery = window.matchMedia('(max-width: 1119px)');
|
||||
|
||||
const headerGroup = () => document.querySelector('.shopify-section-group-header-group');
|
||||
|
||||
const setHeaderOffset = () => {
|
||||
const group = document.querySelector('.shopify-section-group-header-group');
|
||||
const group = headerGroup();
|
||||
if (!group) return;
|
||||
document.documentElement.style.setProperty('--header-offset', group.offsetHeight + 'px');
|
||||
const hidden = !mobileQuery.matches && group.classList.contains('is-header-hidden');
|
||||
document.documentElement.style.setProperty('--header-offset', (hidden ? 0 : group.offsetHeight) + 'px');
|
||||
};
|
||||
|
||||
setHeaderOffset();
|
||||
window.addEventListener('resize', setHeaderOffset);
|
||||
|
||||
const header = document.querySelector('[data-header]');
|
||||
const group = headerGroup();
|
||||
if (header && group && !window.Shopify?.designMode) {
|
||||
let lastY = window.scrollY;
|
||||
let frame = 0;
|
||||
const onScroll = () => {
|
||||
frame = 0;
|
||||
if (mobileQuery.matches) {
|
||||
if (group.classList.contains('is-header-hidden')) {
|
||||
group.classList.remove('is-header-hidden');
|
||||
setHeaderOffset();
|
||||
}
|
||||
lastY = window.scrollY;
|
||||
return;
|
||||
}
|
||||
if (header.classList.contains('is-menu-open') || header.querySelector('.header__search.is-open') || document.documentElement.classList.contains('wish-drawer-open')) {
|
||||
group.classList.remove('is-header-hidden');
|
||||
setHeaderOffset();
|
||||
lastY = window.scrollY;
|
||||
return;
|
||||
}
|
||||
const y = Math.max(0, window.scrollY);
|
||||
const delta = y - lastY;
|
||||
if (Math.abs(delta) < 8) return;
|
||||
const hide = y > group.offsetHeight && delta > 0;
|
||||
if (hide !== group.classList.contains('is-header-hidden')) {
|
||||
group.classList.toggle('is-header-hidden', hide);
|
||||
setHeaderOffset();
|
||||
}
|
||||
lastY = y;
|
||||
};
|
||||
window.addEventListener('scroll', () => {
|
||||
if (frame) return;
|
||||
frame = window.requestAnimationFrame(onScroll);
|
||||
}, { passive: true });
|
||||
}
|
||||
|
||||
const closeMenu = (header) => {
|
||||
const menu = header.querySelector('[data-menu]');
|
||||
const toggle = header.querySelector('[data-menu-toggle]');
|
||||
@@ -508,6 +591,133 @@
|
||||
});
|
||||
}
|
||||
|
||||
const syncSubmenuArrows = (list) => {
|
||||
if (!(list instanceof HTMLElement)) return;
|
||||
const item = list.closest('[data-menu-item]');
|
||||
if (!item) return;
|
||||
const prev = item.querySelector('[data-submenu-scroll="-1"]');
|
||||
const next = item.querySelector('[data-submenu-scroll="1"]');
|
||||
const max = Math.max(0, list.scrollWidth - list.clientWidth);
|
||||
const overflow = mobileQuery.matches && item.classList.contains('is-open') && max > 8;
|
||||
if (prev) prev.hidden = !overflow || list.scrollLeft <= 4;
|
||||
if (next) next.hidden = !overflow || list.scrollLeft >= max - 4;
|
||||
const media = list.querySelector('.header__card-media');
|
||||
if (!overflow || !media) return;
|
||||
const top = media.getBoundingClientRect().top - item.getBoundingClientRect().top + (media.getBoundingClientRect().height - 36) / 2;
|
||||
item.querySelectorAll('[data-submenu-scroll]').forEach((control) => {
|
||||
control.style.top = top + 'px';
|
||||
});
|
||||
};
|
||||
|
||||
menu?.querySelectorAll('.header__submenu--cards').forEach((list) => {
|
||||
list.addEventListener('scroll', () => syncSubmenuArrows(list), { passive: true });
|
||||
});
|
||||
|
||||
let arrowFrame = 0;
|
||||
let arrowDelay = 0;
|
||||
let arrowList = null;
|
||||
let arrowDir = 0;
|
||||
let arrowHolding = false;
|
||||
let arrowTime = 0;
|
||||
|
||||
const stopSubmenuHold = () => {
|
||||
window.clearTimeout(arrowDelay);
|
||||
arrowDelay = 0;
|
||||
arrowHolding = false;
|
||||
arrowList = null;
|
||||
if (arrowFrame) window.cancelAnimationFrame(arrowFrame);
|
||||
arrowFrame = 0;
|
||||
};
|
||||
|
||||
const holdSubmenu = (now) => {
|
||||
if (!arrowHolding || !arrowList) return;
|
||||
const delta = Math.min(40, now - arrowTime);
|
||||
arrowTime = now;
|
||||
const max = Math.max(0, arrowList.scrollWidth - arrowList.clientWidth);
|
||||
arrowList.scrollLeft = Math.min(max, Math.max(0, arrowList.scrollLeft + arrowDir * (delta / 1000) * 420));
|
||||
syncSubmenuArrows(arrowList);
|
||||
const atEdge = arrowDir < 0 ? arrowList.scrollLeft <= 0 : arrowList.scrollLeft >= max - 1;
|
||||
if (atEdge) {
|
||||
stopSubmenuHold();
|
||||
return;
|
||||
}
|
||||
arrowFrame = window.requestAnimationFrame(holdSubmenu);
|
||||
};
|
||||
|
||||
const submenuCards = (list) => [...list.querySelectorAll('.header__card')];
|
||||
|
||||
const submenuIndex = (list) => {
|
||||
const cards = submenuCards(list);
|
||||
const mid = list.getBoundingClientRect().left + list.clientWidth / 2;
|
||||
let index = 0;
|
||||
let best = Infinity;
|
||||
cards.forEach((card, cardIndex) => {
|
||||
const rect = card.getBoundingClientRect();
|
||||
const distance = Math.abs(rect.left + rect.width / 2 - mid);
|
||||
if (distance < best) {
|
||||
best = distance;
|
||||
index = cardIndex;
|
||||
}
|
||||
});
|
||||
return index;
|
||||
};
|
||||
|
||||
const scrollToSubmenuCard = (list, index) => {
|
||||
const cards = submenuCards(list);
|
||||
const card = cards[Math.max(0, Math.min(cards.length - 1, index))];
|
||||
if (!card) return;
|
||||
const listRect = list.getBoundingClientRect();
|
||||
const cardRect = card.getBoundingClientRect();
|
||||
const delta = cardRect.left + cardRect.width / 2 - (listRect.left + listRect.width / 2);
|
||||
list.scrollTo({ left: list.scrollLeft + delta, behavior: 'smooth' });
|
||||
};
|
||||
|
||||
const stepSubmenu = (list, dir) => {
|
||||
scrollToSubmenuCard(list, submenuIndex(list) + dir);
|
||||
};
|
||||
|
||||
menu?.addEventListener('pointerdown', (event) => {
|
||||
const button = event.target.closest('[data-submenu-scroll]');
|
||||
if (!button || !mobileQuery.matches) return;
|
||||
const list = button.closest('[data-menu-item]')?.querySelector('.header__submenu--cards');
|
||||
if (!list) return;
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
stopSubmenuHold();
|
||||
arrowList = list;
|
||||
arrowDir = Number(button.dataset.submenuScroll);
|
||||
try {
|
||||
if (button.setPointerCapture) button.setPointerCapture(event.pointerId);
|
||||
} catch (error) {}
|
||||
arrowDelay = window.setTimeout(() => {
|
||||
arrowHolding = true;
|
||||
arrowTime = window.performance.now();
|
||||
arrowFrame = window.requestAnimationFrame(holdSubmenu);
|
||||
}, 200);
|
||||
});
|
||||
|
||||
const finishSubmenuPointer = () => {
|
||||
if (!arrowList) return;
|
||||
const list = arrowList;
|
||||
const dir = arrowDir;
|
||||
const wasHolding = arrowHolding;
|
||||
stopSubmenuHold();
|
||||
if (wasHolding) scrollToSubmenuCard(list, submenuIndex(list));
|
||||
else stepSubmenu(list, dir);
|
||||
};
|
||||
|
||||
menu?.addEventListener('pointerup', finishSubmenuPointer);
|
||||
menu?.addEventListener('pointercancel', stopSubmenuHold);
|
||||
menu?.addEventListener('click', (event) => {
|
||||
if (!event.target.closest('[data-submenu-scroll]')) return;
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
window.addEventListener('resize', () => {
|
||||
menu?.querySelectorAll('.header__submenu--cards').forEach(syncSubmenuArrows);
|
||||
});
|
||||
|
||||
menu?.addEventListener('click', (event) => {
|
||||
const submenuToggle = event.target.closest('[data-submenu-toggle]');
|
||||
const toggleSubmenu = (submenuToggle) => {
|
||||
@@ -520,6 +730,9 @@
|
||||
});
|
||||
item.classList.toggle('is-open', !expanded);
|
||||
submenuToggle.setAttribute('aria-expanded', expanded ? 'false' : 'true');
|
||||
window.requestAnimationFrame(() => {
|
||||
menu.querySelectorAll('.header__submenu--cards').forEach(syncSubmenuArrows);
|
||||
});
|
||||
};
|
||||
|
||||
if (submenuToggle) {
|
||||
@@ -634,12 +847,19 @@
|
||||
if (!wishList) return;
|
||||
const request = ++wishRequest;
|
||||
const items = readWishItems().filter((item) => item.handle);
|
||||
if (!items.length) {
|
||||
const suggest = wishDrawer?.querySelector('[data-wish-suggest]');
|
||||
const foot = wishDrawer?.querySelector('[data-wish-foot]');
|
||||
const showEmpty = () => {
|
||||
wishList.replaceChildren();
|
||||
const empty = document.createElement('p');
|
||||
empty.className = 'wish-drawer__empty';
|
||||
empty.textContent = wishDrawer?.dataset.empty || '';
|
||||
wishList.append(empty);
|
||||
if (suggest) suggest.hidden = false;
|
||||
if (foot) foot.hidden = true;
|
||||
};
|
||||
if (!items.length) {
|
||||
showEmpty();
|
||||
return;
|
||||
}
|
||||
const products = await Promise.all(items.map(async (item) => {
|
||||
@@ -657,12 +877,12 @@
|
||||
const found = products.filter(Boolean);
|
||||
wishList.replaceChildren();
|
||||
if (!found.length) {
|
||||
const empty = document.createElement('p');
|
||||
empty.className = 'wish-drawer__empty';
|
||||
empty.textContent = wishDrawer?.dataset.empty || '';
|
||||
wishList.append(empty);
|
||||
showEmpty();
|
||||
return;
|
||||
}
|
||||
if (suggest) suggest.hidden = true;
|
||||
const buyable = found.filter((product) => (product.variants || []).some((variant) => variant.available));
|
||||
if (foot) foot.hidden = buyable.length < 2;
|
||||
found.forEach((product) => {
|
||||
const row = document.createElement('article');
|
||||
row.className = 'wish-drawer__item';
|
||||
@@ -693,20 +913,59 @@
|
||||
remove.type = 'button';
|
||||
remove.dataset.wishRemove = product._wishId;
|
||||
remove.textContent = wishDrawer?.dataset.remove || '';
|
||||
row.append(link, copy, remove);
|
||||
const actions = document.createElement('div');
|
||||
actions.className = 'wish-drawer__actions';
|
||||
const variant = (product.variants || []).find((v) => v.available);
|
||||
const add = document.createElement('button');
|
||||
add.className = 'wish-drawer__add';
|
||||
add.type = 'button';
|
||||
if (variant) {
|
||||
add.dataset.wishAdd = String(variant.id);
|
||||
add.textContent = wishDrawer?.dataset.add || 'Agregar';
|
||||
} else {
|
||||
add.disabled = true;
|
||||
add.textContent = wishDrawer?.dataset.soldOut || 'Agotado';
|
||||
}
|
||||
actions.append(add, remove);
|
||||
row.append(link, copy, actions);
|
||||
wishList.append(row);
|
||||
});
|
||||
};
|
||||
|
||||
const addWishToCart = async (ids, button) => {
|
||||
if (!ids.length || !button || button.disabled) return;
|
||||
button.disabled = true;
|
||||
button.classList.add('is-busy');
|
||||
try {
|
||||
const response = await fetch(wishDrawer?.dataset.cartAddUrl || '/cart/add.js', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json', Accept: 'application/json' },
|
||||
body: JSON.stringify({ items: ids.map((id) => ({ id: Number(id), quantity: 1 })) }),
|
||||
});
|
||||
if (!response.ok) throw new Error('add failed');
|
||||
setWishOpen(false);
|
||||
document.dispatchEvent(new CustomEvent('season:cart:open'));
|
||||
} catch (error) {
|
||||
button.classList.add('is-error');
|
||||
window.setTimeout(() => button.classList.remove('is-error'), 1500);
|
||||
} finally {
|
||||
button.disabled = false;
|
||||
button.classList.remove('is-busy');
|
||||
}
|
||||
};
|
||||
|
||||
const setWishOpen = (open) => {
|
||||
if (!wishDrawer || !wishButton) return;
|
||||
if (open && wishDrawer.parentElement !== document.body) document.body.appendChild(wishDrawer);
|
||||
wishDrawer.classList.toggle('is-open', open);
|
||||
wishDrawer.setAttribute('aria-hidden', open ? 'false' : 'true');
|
||||
wishDrawer.inert = !open;
|
||||
document.querySelectorAll('[data-wish-open]').forEach((control) => {
|
||||
control.setAttribute('aria-expanded', open ? 'true' : 'false');
|
||||
});
|
||||
document.documentElement.classList.toggle('overflow-hidden', open);
|
||||
document.documentElement.classList.toggle('wish-drawer-open', open);
|
||||
if (open) {
|
||||
document.querySelector('.shopify-section-group-header-group')?.classList.remove('is-header-hidden');
|
||||
document.querySelectorAll('[data-header]').forEach((header) => {
|
||||
closeMenu(header);
|
||||
closeSearch(header);
|
||||
@@ -735,6 +994,15 @@
|
||||
wishButton?.focus();
|
||||
return;
|
||||
}
|
||||
const addOne = event.target.closest('[data-wish-add]');
|
||||
const addAll = event.target.closest('[data-wish-add-all]');
|
||||
if (addOne || addAll) {
|
||||
const ids = addAll
|
||||
? [...(wishDrawer?.querySelectorAll('[data-wish-list] [data-wish-add]') || [])].map((b) => b.dataset.wishAdd)
|
||||
: [addOne.dataset.wishAdd];
|
||||
addWishToCart(ids.filter(Boolean), addOne || addAll);
|
||||
return;
|
||||
}
|
||||
const remove = event.target.closest('[data-wish-remove]');
|
||||
if (!remove) return;
|
||||
const id = remove.dataset.wishRemove;
|
||||
@@ -784,6 +1052,12 @@
|
||||
"type": "url",
|
||||
"id": "promo_link",
|
||||
"label": "t:header.promo_link"
|
||||
},
|
||||
{
|
||||
"type": "collection",
|
||||
"id": "wishlist_suggestions",
|
||||
"label": "Sugerencias en Favoritos vacío",
|
||||
"info": "Por defecto: Los más vendidos."
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -13,12 +13,56 @@
|
||||
assign cover_mobile = 'mascara-vido-mobile.avif' | asset_url
|
||||
endif
|
||||
|
||||
comment
|
||||
Video hero: use the video's own first frame as the cover (LCP image). It is tiny
|
||||
(AVIF ~20 KB desktop / ~8 KB mobile) and identical to frame 0, so the switch to video is seamless.
|
||||
endcomment
|
||||
assign cover_w = 1920
|
||||
assign cover_h = 650
|
||||
if media_type == 'video' and section.settings.poster_from_video
|
||||
comment
|
||||
Shopify's video preview image is frame 0 of the video, served as AVIF/WebP by the CDN.
|
||||
endcomment
|
||||
if section.settings.video.preview_image
|
||||
assign cover_desktop = section.settings.video.preview_image | image_url: width: 1280
|
||||
assign cover_w = section.settings.video.preview_image.width | at_most: 1280
|
||||
assign cover_h = section.settings.video.preview_image.height | times: cover_w | divided_by: section.settings.video.preview_image.width
|
||||
else
|
||||
assign cover_desktop = 'hero-frame-desktop.avif' | asset_url
|
||||
assign cover_w = 1280
|
||||
assign cover_h = 720
|
||||
endif
|
||||
if section.settings.video_mobile.preview_image
|
||||
assign cover_mobile = section.settings.video_mobile.preview_image | image_url: width: 720
|
||||
elsif section.settings.use_light_mobile_video
|
||||
assign cover_mobile = 'hero-frame-mobile.avif' | asset_url
|
||||
elsif section.settings.video.preview_image
|
||||
assign cover_mobile = section.settings.video.preview_image | image_url: width: 900
|
||||
else
|
||||
assign cover_mobile = cover_desktop
|
||||
endif
|
||||
endif
|
||||
|
||||
assign video_src = blank
|
||||
assign video_src_mobile = blank
|
||||
if media_type == 'video'
|
||||
if section.settings.video != blank
|
||||
comment
|
||||
Desktop: the largest MP4 up to 1080p. Mobile: the smallest MP4 that is at least 480p.
|
||||
endcomment
|
||||
assign best_h = 0
|
||||
assign mobile_h = 99999
|
||||
for source in section.settings.video.sources
|
||||
if source.mime_type == 'video/mp4' or source.format == 'mp4'
|
||||
assign video_src = source.url
|
||||
assign h = source.height | default: 0
|
||||
if h <= 1080 and h >= best_h
|
||||
assign best_h = h
|
||||
assign video_src = source.url
|
||||
endif
|
||||
if h >= 480 and h < mobile_h
|
||||
assign mobile_h = h
|
||||
assign video_src_mobile = source.url
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
@@ -26,6 +70,39 @@
|
||||
if video_src == blank
|
||||
assign video_src = 'home-video-op.mp4' | asset_url
|
||||
endif
|
||||
|
||||
comment
|
||||
Mobile: a dedicated vertical, light video (setting) or the theme's hero-mobile.mp4 (~450 KB, cropped 516x720).
|
||||
endcomment
|
||||
if section.settings.video_mobile != blank
|
||||
assign mobile_h = 99999
|
||||
for source in section.settings.video_mobile.sources
|
||||
if source.mime_type == 'video/mp4' or source.format == 'mp4'
|
||||
assign h = source.height | default: 0
|
||||
if h >= 480 and h < mobile_h
|
||||
assign mobile_h = h
|
||||
assign video_src_mobile = source.url
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
elsif section.settings.use_light_mobile_video
|
||||
assign video_src_mobile = 'hero-mobile.mp4' | asset_url
|
||||
endif
|
||||
|
||||
comment
|
||||
Theme-hosted optimized videos (no Shopify re-encoding: ~1 MB desktop / ~0.4 MB mobile)
|
||||
plus their first frames as the cover. These files must match the videos picked above.
|
||||
endcomment
|
||||
if section.settings.theme_hosted_videos
|
||||
assign video_src = 'seasons-hero-desktop.mp4' | asset_url
|
||||
assign video_src_mobile = 'seasons-hero-mobile.mp4' | asset_url
|
||||
if section.settings.poster_from_video
|
||||
assign cover_desktop = 'hero-frame-desktop.avif' | asset_url
|
||||
assign cover_mobile = 'hero-frame-mobile.avif' | asset_url
|
||||
assign cover_w = 1280
|
||||
assign cover_h = 720
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
if section.settings.social_label != blank
|
||||
@@ -70,8 +147,6 @@
|
||||
data-cart-add-url="{{ routes.cart_add_url }}.js"
|
||||
data-cart-url="{{ routes.cart_url }}.js"
|
||||
>
|
||||
<link rel="preload" as="image" href="{{ cover_desktop }}" media="(min-width: 1024px)" fetchpriority="high">
|
||||
<link rel="preload" as="image" href="{{ cover_mobile }}" media="(max-width: 1023px)" fetchpriority="high">
|
||||
|
||||
<div class="hero__media" aria-hidden="true">
|
||||
{% if media_type == 'image' %}
|
||||
@@ -90,22 +165,24 @@
|
||||
<video
|
||||
class="hero__video"
|
||||
data-hero-video
|
||||
data-src-desktop="{{ video_src }}"
|
||||
data-src-mobile="{{ video_src_mobile | default: video_src }}"
|
||||
muted
|
||||
loop
|
||||
playsinline
|
||||
preload="none"
|
||||
>
|
||||
<source src="{{ video_src }}" type="video/mp4">
|
||||
</video>
|
||||
<picture class="hero__poster">
|
||||
<source media="(max-width: 1023px)" srcset="{{ cover_mobile }}">
|
||||
<img
|
||||
class="hero__poster-image"
|
||||
src="{{ cover_desktop }}"
|
||||
alt=""
|
||||
width="1920"
|
||||
height="650"
|
||||
alt=""
|
||||
width="{{ cover_w }}"
|
||||
height="{{ cover_h }}"
|
||||
fetchpriority="high"
|
||||
decoding="sync"
|
||||
>
|
||||
</picture>
|
||||
{% endif %}
|
||||
@@ -134,6 +211,11 @@
|
||||
{% for block in section.blocks %}
|
||||
{% liquid
|
||||
assign featured_product = block.settings.product
|
||||
if featured_product != blank
|
||||
unless featured_product.available
|
||||
assign featured_product = blank
|
||||
endunless
|
||||
endif
|
||||
if featured_product == blank and forloop.first
|
||||
assign featured_product = fallback_product
|
||||
endif
|
||||
@@ -204,24 +286,61 @@
|
||||
window.__seasonHeroVideo = true;
|
||||
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return;
|
||||
|
||||
const events = ['keydown', 'mousedown', 'mousemove', 'touchstart', 'wheel'];
|
||||
const start = () => {
|
||||
events.forEach((eventName) => window.removeEventListener(eventName, start));
|
||||
// The cover (first frame of the video) is the LCP image. Once the page has loaded we
|
||||
// start buffering the video, and it starts playing 3 s after the cover was shown.
|
||||
const HOLD_MS = 3000;
|
||||
const shownAt = performance.now();
|
||||
let buffering = false;
|
||||
|
||||
const buffer = () => {
|
||||
if (buffering) return;
|
||||
buffering = true;
|
||||
events.forEach((eventName) => window.removeEventListener(eventName, buffer));
|
||||
const mobile = window.matchMedia('(max-width: 1023px)').matches;
|
||||
document.querySelectorAll('[data-hero-video]').forEach((video) => {
|
||||
const src = (mobile ? video.dataset.srcMobile : video.dataset.srcDesktop) || video.dataset.srcDesktop;
|
||||
if (!src) return;
|
||||
const hero = video.closest('[data-hero]');
|
||||
video.addEventListener('playing', () => hero?.classList.add('is-playing'));
|
||||
if (!video.getAttribute('src')) video.src = src;
|
||||
video.preload = 'auto';
|
||||
video.load();
|
||||
const play = () => {
|
||||
const attempt = video.play();
|
||||
if (attempt && typeof attempt.catch === 'function') attempt.catch(() => {});
|
||||
};
|
||||
video.addEventListener('playing', () => hero?.classList.add('is-playing'));
|
||||
video.preload = 'auto';
|
||||
if (video.readyState >= 2) play();
|
||||
else video.addEventListener('canplay', play, { once: true });
|
||||
video.load();
|
||||
const wait = Math.max(0, HOLD_MS - (performance.now() - shownAt));
|
||||
window.setTimeout(() => {
|
||||
if (video.readyState >= 3) play();
|
||||
else video.addEventListener('canplay', play, { once: true });
|
||||
}, wait);
|
||||
});
|
||||
};
|
||||
|
||||
events.forEach((eventName) => window.addEventListener(eventName, start, { passive: true }));
|
||||
// Buffering begins after load (so it never competes with the cover image) or on the first interaction.
|
||||
const events = ['keydown', 'mousedown', 'touchstart', 'wheel', 'scroll'];
|
||||
events.forEach((eventName) => window.addEventListener(eventName, buffer, { passive: true }));
|
||||
const conn = navigator.connection;
|
||||
const slow = conn && (conn.saveData || /2g/.test(conn.effectiveType || ''));
|
||||
if (!slow) {
|
||||
// Wait for the page load AND for the cover (LCP image) to be painted, then an idle moment,
|
||||
// so the video download never competes with the cover.
|
||||
const cover = document.querySelector('.hero__poster-image');
|
||||
const coverReady = () => new Promise((resolve) => {
|
||||
if (!cover || cover.complete) return resolve();
|
||||
cover.addEventListener('load', resolve, { once: true });
|
||||
cover.addEventListener('error', resolve, { once: true });
|
||||
});
|
||||
const pageLoaded = () => new Promise((resolve) => {
|
||||
if (document.readyState === 'complete') resolve();
|
||||
else window.addEventListener('load', resolve, { once: true });
|
||||
});
|
||||
const idle = () => new Promise((resolve) => {
|
||||
if ('requestIdleCallback' in window) window.requestIdleCallback(() => resolve(), { timeout: 1500 });
|
||||
else window.setTimeout(resolve, 300);
|
||||
});
|
||||
Promise.all([pageLoaded(), coverReady()]).then(idle).then(buffer);
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
@@ -253,22 +372,11 @@
|
||||
|
||||
const markPlaying = () => hero.classList.add('is-playing');
|
||||
video.addEventListener('playing', markPlaying);
|
||||
|
||||
const tryPlay = () => {
|
||||
const playAttempt = video.play();
|
||||
if (playAttempt && typeof playAttempt.catch === 'function') {
|
||||
playAttempt.catch(() => {});
|
||||
}
|
||||
};
|
||||
|
||||
if (video.readyState >= 2) {
|
||||
tryPlay();
|
||||
} else {
|
||||
video.addEventListener('canplay', tryPlay, { once: true });
|
||||
}
|
||||
// Playback timing (3 s hold on the first-frame cover) is handled by the inline hero script.
|
||||
});
|
||||
|
||||
document.addEventListener('submit', async (event) => {
|
||||
if (event.defaultPrevented) return;
|
||||
const form = event.target;
|
||||
if (!(form instanceof HTMLFormElement) || !form.classList.contains('hero__form')) return;
|
||||
|
||||
@@ -319,7 +427,10 @@
|
||||
"class": "hero-section",
|
||||
"max_blocks": 2,
|
||||
"disabled_on": {
|
||||
"groups": ["header", "footer"]
|
||||
"groups": [
|
||||
"header",
|
||||
"footer"
|
||||
]
|
||||
},
|
||||
"settings": [
|
||||
{
|
||||
@@ -338,8 +449,14 @@
|
||||
"label": "t:hero.line_1_weight",
|
||||
"default": "light",
|
||||
"options": [
|
||||
{ "value": "light", "label": "t:hero.weight_light" },
|
||||
{ "value": "medium", "label": "t:hero.weight_medium" }
|
||||
{
|
||||
"value": "light",
|
||||
"label": "t:hero.weight_light"
|
||||
},
|
||||
{
|
||||
"value": "medium",
|
||||
"label": "t:hero.weight_medium"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -354,8 +471,14 @@
|
||||
"label": "t:hero.line_2_weight",
|
||||
"default": "medium",
|
||||
"options": [
|
||||
{ "value": "light", "label": "t:hero.weight_light" },
|
||||
{ "value": "medium", "label": "t:hero.weight_medium" }
|
||||
{
|
||||
"value": "light",
|
||||
"label": "t:hero.weight_light"
|
||||
},
|
||||
{
|
||||
"value": "medium",
|
||||
"label": "t:hero.weight_medium"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -370,8 +493,14 @@
|
||||
"label": "t:hero.line_3_weight",
|
||||
"default": "light",
|
||||
"options": [
|
||||
{ "value": "light", "label": "t:hero.weight_light" },
|
||||
{ "value": "medium", "label": "t:hero.weight_medium" }
|
||||
{
|
||||
"value": "light",
|
||||
"label": "t:hero.weight_light"
|
||||
},
|
||||
{
|
||||
"value": "medium",
|
||||
"label": "t:hero.weight_medium"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -390,8 +519,14 @@
|
||||
"label": "t:hero.media_type",
|
||||
"default": "video",
|
||||
"options": [
|
||||
{ "value": "video", "label": "t:hero.media_video" },
|
||||
{ "value": "image", "label": "t:hero.media_image" }
|
||||
{
|
||||
"value": "video",
|
||||
"label": "t:hero.media_video"
|
||||
},
|
||||
{
|
||||
"value": "image",
|
||||
"label": "t:hero.media_image"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -401,6 +536,37 @@
|
||||
"info": "t:hero.video_info",
|
||||
"visible_if": "{{ section.settings.media_type == 'video' }}"
|
||||
},
|
||||
{
|
||||
"type": "video",
|
||||
"id": "video_mobile",
|
||||
"label": "Video móvil (vertical, ligero)",
|
||||
"info": "Opcional. Recomendado: vertical, sin audio, menos de 1 MB.",
|
||||
"visible_if": "{{ section.settings.media_type == 'video' }}"
|
||||
},
|
||||
{
|
||||
"type": "checkbox",
|
||||
"id": "use_light_mobile_video",
|
||||
"label": "Usar versión ligera incluida en el tema para móvil",
|
||||
"info": "Recorte vertical del video actual (~450 KB). Desactívalo si cambias el video principal y no subes uno móvil.",
|
||||
"default": true,
|
||||
"visible_if": "{{ section.settings.media_type == 'video' }}"
|
||||
},
|
||||
{
|
||||
"type": "checkbox",
|
||||
"id": "poster_from_video",
|
||||
"label": "Portada = primer cuadro del video",
|
||||
"info": "Muestra el primer cuadro del video (imagen ligera precargada) 3 s antes de reproducir. Desactívalo para usar las portadas de abajo.",
|
||||
"default": true,
|
||||
"visible_if": "{{ section.settings.media_type == 'video' }}"
|
||||
},
|
||||
{
|
||||
"type": "checkbox",
|
||||
"id": "theme_hosted_videos",
|
||||
"label": "Usar videos optimizados del tema",
|
||||
"info": "Sirve seasons-hero-desktop.mp4 (~1 MB) y seasons-hero-mobile.mp4 (~0.4 MB) desde el tema, sin la recompresión de Shopify (que los vuelve ~2 MB). Si cambias los videos, actualiza esos archivos o desactiva esta opción.",
|
||||
"default": true,
|
||||
"visible_if": "{{ section.settings.media_type == 'video' }}"
|
||||
},
|
||||
{
|
||||
"type": "image_picker",
|
||||
"id": "cover_desktop",
|
||||
@@ -456,7 +622,9 @@
|
||||
{
|
||||
"name": "t:hero.name",
|
||||
"blocks": [
|
||||
{ "type": "featured_product" }
|
||||
{
|
||||
"type": "featured_product"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -60,24 +60,21 @@
|
||||
assign fallback_image = blank
|
||||
case forloop.index
|
||||
when 1
|
||||
assign fallback_image = 'learn-cover-1.avif'
|
||||
assign fallback_image = 'video-11.png'
|
||||
when 2
|
||||
assign fallback_image = 'learn-cover-2.avif'
|
||||
assign fallback_image = 'video-22.png'
|
||||
when 3
|
||||
assign fallback_image = 'reel1.jpg'
|
||||
assign fallback_image = 'learn-reel-3.avif'
|
||||
when 4
|
||||
assign fallback_image = 'learn-cover-4.avif'
|
||||
assign fallback_image = 'video-44.png'
|
||||
when 5
|
||||
assign fallback_image = 'learn-cover-5.avif'
|
||||
assign fallback_image = 'video-55.png'
|
||||
endcase
|
||||
|
||||
assign poster_alt = heading
|
||||
assign slide_state = ''
|
||||
if forloop.index0 == active_index
|
||||
assign slide_state = ' is-active'
|
||||
if video_src != blank
|
||||
assign slide_state = slide_state | append: ' is-playing'
|
||||
endif
|
||||
endif
|
||||
%}
|
||||
<article
|
||||
@@ -103,10 +100,12 @@
|
||||
src="{{ fallback_image | asset_url }}"
|
||||
alt="{{ poster_alt | escape }}"
|
||||
width="384"
|
||||
height="680"
|
||||
height="{% if fallback_image contains '.png' %}518{% else %}680{% endif %}"
|
||||
loading="lazy"
|
||||
srcset="{{ fallback_image | replace: '.avif', '-sm.avif' | asset_url }} 400w, {{ fallback_image | asset_url }} 780w"
|
||||
sizes="(max-width: 1024px) 220px, 384px"
|
||||
{% unless fallback_image contains '.png' %}
|
||||
srcset="{{ fallback_image | replace: '.avif', '-sm.avif' | asset_url }} 360w, {{ fallback_image | asset_url }} 720w"
|
||||
sizes="(max-width: 1024px) 200px, 384px"
|
||||
{% endunless %}
|
||||
decoding="async"
|
||||
>
|
||||
{% endif %}
|
||||
@@ -114,23 +113,20 @@
|
||||
<video
|
||||
class="learn__video"
|
||||
data-learn-video
|
||||
src="{{ video_src }}"
|
||||
data-src="{{ video_src }}"
|
||||
{% if block.settings.poster != blank %}
|
||||
poster="{{ block.settings.poster | image_url: width: 800 }}"
|
||||
{% elsif fallback_image != blank %}
|
||||
poster="{{ fallback_image | asset_url }}"
|
||||
{% endif %}
|
||||
muted
|
||||
playsinline
|
||||
loop
|
||||
{% if forloop.index0 == active_index %}
|
||||
autoplay
|
||||
preload="auto"
|
||||
{% else %}
|
||||
preload="none"
|
||||
{% endif %}
|
||||
preload="none"
|
||||
></video>
|
||||
<button class="learn__play" type="button" data-learn-play aria-label="{{ 'learn.play_sound' | t }}">
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" aria-hidden="true" focusable="false"><path d="M7 4.5v13l11-6.5z" fill="currentColor"/></svg>
|
||||
</button>
|
||||
<button class="learn__sound" type="button" data-learn-sound aria-pressed="false" aria-label="{{ 'learn.sound_on' | t }}" data-label-on="{{ 'learn.sound_on' | t }}" data-label-off="{{ 'learn.sound_off' | t }}">
|
||||
<svg class="learn__sound-off" width="18" height="18" viewBox="0 0 18 18" aria-hidden="true" focusable="false"><path d="M3 6.5h2.5L9 3.5v11L5.5 11.5H3z" fill="currentColor"/><path d="M12 6.5l4 5M16 6.5l-4 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>
|
||||
<svg class="learn__sound-on" width="18" height="18" viewBox="0 0 18 18" aria-hidden="true" focusable="false"><path d="M3 6.5h2.5L9 3.5v11L5.5 11.5H3z" fill="currentColor"/><path d="M12 6.2a3.6 3.6 0 0 1 0 5.6M14 4.2a6.3 6.3 0 0 1 0 9.6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>
|
||||
<span class="learn__sound-text">{{ 'learn.tap_sound' | t }}</span>
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
</article>
|
||||
@@ -138,6 +134,102 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script nolazy>
|
||||
(function () {
|
||||
if (window.__learnReelClicks) return;
|
||||
window.__learnReelClicks = true;
|
||||
var setSoundUi = function (root) {
|
||||
var on = root.dataset.sound === 'on';
|
||||
root.querySelectorAll('[data-learn-sound]').forEach(function (b) {
|
||||
b.setAttribute('aria-pressed', on ? 'true' : 'false');
|
||||
b.setAttribute('aria-label', on ? b.dataset.labelOff : b.dataset.labelOn);
|
||||
});
|
||||
root.classList.toggle('has-sound', on);
|
||||
};
|
||||
var watch = function (slide, video) {
|
||||
if (video.dataset.watched) return;
|
||||
video.dataset.watched = '1';
|
||||
video.addEventListener('playing', function () { slide.classList.add('is-playing'); slide.classList.remove('is-paused'); });
|
||||
video.addEventListener('pause', function () { if (slide.classList.contains('is-active')) slide.classList.add('is-paused'); });
|
||||
};
|
||||
var start = function (root, slide, video) {
|
||||
root.dataset.sound = 'on';
|
||||
setSoundUi(root);
|
||||
if (video.dataset.src && video.getAttribute('src') !== video.dataset.src) { video.src = video.dataset.src; video.load(); }
|
||||
video.dataset.loaded = 'true';
|
||||
video.muted = false;
|
||||
watch(slide, video);
|
||||
slide.classList.add('is-playing');
|
||||
slide.classList.remove('is-paused');
|
||||
var p = video.play();
|
||||
if (p && p.catch) p.catch(function () {
|
||||
video.muted = true;
|
||||
root.dataset.sound = 'off';
|
||||
setSoundUi(root);
|
||||
video.play().catch(function () {});
|
||||
});
|
||||
};
|
||||
// Autoplay (muted) only while the reels are on screen.
|
||||
if ('IntersectionObserver' in window) {
|
||||
var io = new IntersectionObserver(function (entries) {
|
||||
entries.forEach(function (entry) {
|
||||
var root = entry.target;
|
||||
var active = root.querySelector('[data-slide].is-active');
|
||||
var video = active && active.querySelector('[data-learn-video]');
|
||||
if (entry.isIntersecting) {
|
||||
root.dataset.inview = '1';
|
||||
if (video && video.paused && !active.classList.contains('is-paused')) {
|
||||
if (video.dataset.src && video.getAttribute('src') !== video.dataset.src) { video.src = video.dataset.src; video.dataset.loaded = 'true'; }
|
||||
video.muted = root.dataset.sound !== 'on';
|
||||
watch(active, video);
|
||||
var p = video.play(); if (p && p.catch) p.catch(function () {});
|
||||
}
|
||||
} else {
|
||||
root.dataset.inview = '0';
|
||||
if (video && !video.paused) { video.pause(); active.classList.remove('is-paused'); }
|
||||
}
|
||||
});
|
||||
}, { rootMargin: '100px 0px' });
|
||||
var observe = function () { document.querySelectorAll('[data-learn]').forEach(function (r) { io.observe(r); }); };
|
||||
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', observe); else observe();
|
||||
}
|
||||
document.addEventListener('click', function (event) {
|
||||
// The carousel drag code uses pointer capture, which retargets the click to the viewport.
|
||||
var hit = event.target.closest('[data-learn] .learn__media') ? event.target : document.elementFromPoint(event.clientX, event.clientY);
|
||||
var media = hit && hit.closest('[data-learn] .learn__media');
|
||||
if (media && !event.target.closest('[data-learn]')) media = null;
|
||||
if (!media) return;
|
||||
var root = media.closest('[data-learn]');
|
||||
var slide = media.closest('[data-slide]');
|
||||
var video = slide && slide.querySelector('[data-learn-video]');
|
||||
if (!video) return;
|
||||
event.preventDefault();
|
||||
var slides = [].slice.call(root.querySelectorAll('[data-slide]'));
|
||||
var i = slides.indexOf(slide);
|
||||
if (hit.closest('[data-learn-sound]')) {
|
||||
var on = root.dataset.sound !== 'on';
|
||||
root.dataset.sound = on ? 'on' : 'off';
|
||||
setSoundUi(root);
|
||||
video.muted = !on;
|
||||
if (video.paused) start(root, slide, video);
|
||||
if (!on) video.muted = true;
|
||||
return;
|
||||
}
|
||||
if (!slide.classList.contains('is-active')) {
|
||||
slides.forEach(function (s) { if (s !== slide) { var v = s.querySelector('[data-learn-video]'); if (v) v.pause(); } });
|
||||
start(root, slide, video);
|
||||
if (root.__learnGo) root.__learnGo(i);
|
||||
else {
|
||||
root.dataset.pending = String(i);
|
||||
slides.forEach(function (s) { s.classList.toggle('is-active', s === slide); });
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (video.paused || video.muted) start(root, slide, video);
|
||||
else video.pause();
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
<button class="learn__arrow learn__arrow--prev" type="button" data-learn-prev aria-label="{{ 'learn.previous' | t }}">
|
||||
<span class="learn__arrow-icon" aria-hidden="true">
|
||||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
@@ -165,7 +257,7 @@
|
||||
assign slide_product = block.settings.product_2
|
||||
endif
|
||||
%}
|
||||
{% if slide_product != blank %}
|
||||
{% if slide_product != blank and slide_product.available %}
|
||||
{% liquid
|
||||
assign variant = slide_product.selected_or_first_available_variant
|
||||
assign card_image = slide_product.featured_image
|
||||
@@ -258,7 +350,13 @@
|
||||
|
||||
const playSlide = (slide) => {
|
||||
const video = slide.querySelector('[data-learn-video]');
|
||||
if (!video || reduceMotion) return;
|
||||
if (!video) return;
|
||||
const root = slide.closest('[data-learn]');
|
||||
const soundOn = root && root.dataset.sound === 'on';
|
||||
if (reduceMotion && !soundOn) return;
|
||||
// Only download/play once the section is on screen (or the visitor asked for sound).
|
||||
if (!soundOn && root && root.dataset.inview !== '1') return;
|
||||
video.muted = !soundOn;
|
||||
if (video.dataset.loaded !== 'true' && video.dataset.src) {
|
||||
video.dataset.loaded = 'true';
|
||||
if (video.getAttribute('src') !== video.dataset.src) {
|
||||
@@ -276,6 +374,7 @@
|
||||
const stopSlide = (slide) => {
|
||||
const video = slide.querySelector('[data-learn-video]');
|
||||
slide.classList.remove('is-playing');
|
||||
slide.classList.remove('is-paused');
|
||||
if (video && video.dataset.loaded === 'true') video.pause();
|
||||
};
|
||||
|
||||
@@ -329,6 +428,7 @@
|
||||
index = target;
|
||||
paint(true);
|
||||
};
|
||||
root.__learnGo = go;
|
||||
|
||||
prev?.addEventListener('click', () => go(index - 1));
|
||||
next?.addEventListener('click', () => go(index + 1));
|
||||
@@ -416,6 +516,10 @@
|
||||
}
|
||||
|
||||
window.addEventListener('resize', () => paint(false));
|
||||
if (root.dataset.pending) {
|
||||
index = Math.min(Math.max(Number(root.dataset.pending) || 0, 0), slides.length - 1);
|
||||
delete root.dataset.pending;
|
||||
}
|
||||
paint(false);
|
||||
};
|
||||
|
||||
@@ -431,6 +535,7 @@
|
||||
if (!window.__seasonLearn) {
|
||||
window.__seasonLearn = true;
|
||||
document.addEventListener('submit', async (event) => {
|
||||
if (event.defaultPrevented) return;
|
||||
const form = event.target;
|
||||
if (!(form instanceof HTMLFormElement) || !form.classList.contains('learn__form')) return;
|
||||
const root = form.closest('[data-learn]');
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -34,8 +34,27 @@
|
||||
{%- endif -%}
|
||||
</span>
|
||||
<span class="header__predictive-copy">
|
||||
{%- liquid
|
||||
assign ps_variant = product.selected_or_first_available_variant
|
||||
assign ps_on_sale = false
|
||||
if ps_variant.compare_at_price > ps_variant.price
|
||||
assign ps_on_sale = true
|
||||
assign ps_saving = ps_variant.compare_at_price | minus: ps_variant.price | times: 100.0 | divided_by: ps_variant.compare_at_price | round
|
||||
endif
|
||||
-%}
|
||||
{%- if ps_on_sale -%}
|
||||
<span class="inline-flex w-fit rounded-[3px] bg-[#f8d5ce] px-1.5 py-[3px] text-[10px] font-medium uppercase leading-none text-[#e35b4c]">{{ 'header.search_sale' | t }} -{{ ps_saving }}%</span>
|
||||
{%- endif -%}
|
||||
<span class="header__predictive-title">{{ product.title | escape }}</span>
|
||||
<span class="header__predictive-price">{{ product.price | money_without_trailing_zeros }}</span>
|
||||
<span class="header__predictive-price{% if ps_on_sale %} header__predictive-price--sale{% endif %}">
|
||||
{%- if ps_on_sale -%}
|
||||
<span class="sr-only">{{ 'header.search_sale_price' | t }}</span>
|
||||
{{ ps_variant.price | money_without_trailing_zeros }}
|
||||
<s class="ml-1 text-[13px] font-normal text-[#a3a3a3]"><span class="sr-only">{{ 'header.search_regular_price' | t }}</span>{{ ps_variant.compare_at_price | money_without_trailing_zeros }}</s>
|
||||
{%- else -%}
|
||||
{{ product.price | money_without_trailing_zeros }}
|
||||
{%- endif -%}
|
||||
</span>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@@ -30,8 +30,37 @@
|
||||
if excerpt == blank
|
||||
assign excerpt = product.metafields.custom.short_description.value | default: product.metafields.custom.excerpt.value
|
||||
endif
|
||||
if excerpt == blank
|
||||
assign excerpt = product.description | strip_html | truncate: 180
|
||||
assign excerpt_from_description = false
|
||||
if excerpt == blank and product.description != blank
|
||||
assign excerpt_from_description = true
|
||||
assign excerpt_parts = product.description | replace: '</p>', '[[br]]' | replace: '</h1>', '[[br]]' | replace: '</h2>', '[[br]]' | replace: '</h3>', '[[br]]' | replace: '</h4>', '[[br]]' | replace: '</h5>', '[[br]]' | replace: '</h6>', '[[br]]' | replace: '</li>', '[[br]]' | replace: '<br>', '[[br]]' | replace: '<br/>', '[[br]]' | replace: '<br />', '[[br]]' | strip_html | split: '[[br]]'
|
||||
comment
|
||||
First paragraph: the first <p> of the description (falls back to the first text block).
|
||||
endcomment
|
||||
assign excerpt = ''
|
||||
if product.description contains '</p>'
|
||||
assign excerpt = product.description | split: '</p>' | first | split: '<p' | last | split: '>' | slice: 1, 999 | join: '>' | strip_html | strip
|
||||
endif
|
||||
if excerpt == blank
|
||||
for part in excerpt_parts
|
||||
assign part_text = part | strip
|
||||
if part_text != blank
|
||||
assign excerpt = part_text
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
assign excerpt_count = 0
|
||||
for part in excerpt_parts
|
||||
assign part_text = part | strip
|
||||
if part_text != blank
|
||||
assign excerpt_count = excerpt_count | plus: 1
|
||||
endif
|
||||
endfor
|
||||
assign excerpt_has_more = false
|
||||
if excerpt_count > 1
|
||||
assign excerpt_has_more = true
|
||||
endif
|
||||
endif
|
||||
|
||||
assign how_field = product.metafields.custom.como_aplicarlo
|
||||
@@ -132,6 +161,17 @@
|
||||
assign show_reviews = true
|
||||
endif
|
||||
|
||||
comment
|
||||
Hide the reviews module (and the stars under the title) when the average rating is below 3.5.
|
||||
endcomment
|
||||
assign reviews_min_rating = section.settings.reviews_min_rating | default: 3.5 | times: 1.0
|
||||
assign rating_average = product.metafields.reviews.rating.value.rating | default: 0 | times: 1.0
|
||||
assign low_rating = false
|
||||
if rating_count > 0 and rating_average < reviews_min_rating
|
||||
assign low_rating = true
|
||||
assign show_reviews = false
|
||||
endif
|
||||
|
||||
assign review_pages = review_count | plus: 2 | divided_by: 3
|
||||
assign main_alt = main_image.alt | default: product.title
|
||||
%}
|
||||
@@ -146,8 +186,14 @@
|
||||
>
|
||||
<div class="product__hero">
|
||||
<div class="product__gallery">
|
||||
<div class="product__main">
|
||||
{% if main_image %}
|
||||
{% if main_image %}
|
||||
<button
|
||||
type="button"
|
||||
class="product__main"
|
||||
data-gallery-open
|
||||
data-full="{{ main_image | image_url: width: 2000 }}"
|
||||
aria-label="{{ 'product_page.gallery_open' | t }}"
|
||||
>
|
||||
{{
|
||||
main_image
|
||||
| image_url: width: 1400
|
||||
@@ -156,14 +202,16 @@
|
||||
alt: main_alt,
|
||||
loading: 'eager',
|
||||
fetchpriority: 'high',
|
||||
widths: '700, 1000, 1400',
|
||||
widths: '360, 540, 720, 1000, 1400',
|
||||
sizes: '(min-width: 1120px) 58vw, 100vw',
|
||||
data-main-image: 'true'
|
||||
}}
|
||||
{% else %}
|
||||
</button>
|
||||
{% else %}
|
||||
<div class="product__main">
|
||||
{{ 'product-1' | placeholder_svg_tag: 'product__main-image' }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if product.images.size > 1 %}
|
||||
{% assign gallery_count = 0 %}
|
||||
{% if main_image != blank %}
|
||||
@@ -176,7 +224,13 @@
|
||||
{% endfor %}
|
||||
<div class="product__thumbs" data-product-thumbs>
|
||||
{% if main_image != blank %}
|
||||
<div class="product__thumb product__thumb--main">
|
||||
<button
|
||||
type="button"
|
||||
class="product__thumb product__thumb--main"
|
||||
data-gallery-open
|
||||
data-full="{{ main_image | image_url: width: 2000 }}"
|
||||
aria-label="{{ 'product_page.gallery_open' | t }}"
|
||||
>
|
||||
{{
|
||||
main_image
|
||||
| image_url: width: 1400
|
||||
@@ -184,27 +238,33 @@
|
||||
alt: main_alt,
|
||||
loading: 'eager',
|
||||
fetchpriority: 'high',
|
||||
widths: '700, 1000, 1400',
|
||||
sizes: '100vw',
|
||||
widths: '360, 540, 720, 1000, 1400',
|
||||
sizes: '92vw',
|
||||
draggable: false
|
||||
}}
|
||||
</div>
|
||||
</button>
|
||||
{% endif %}
|
||||
{% for image in product.images %}
|
||||
{% if image.id != main_image.id %}
|
||||
{% assign thumb_alt = image.alt | default: product.title %}
|
||||
<div class="product__thumb">
|
||||
<button
|
||||
type="button"
|
||||
class="product__thumb"
|
||||
data-gallery-open
|
||||
data-full="{{ image | image_url: width: 2000 }}"
|
||||
aria-label="{{ 'product_page.gallery_open' | t }}"
|
||||
>
|
||||
{{
|
||||
image
|
||||
| image_url: width: 900
|
||||
| image_tag:
|
||||
alt: thumb_alt,
|
||||
loading: 'lazy',
|
||||
widths: '400, 700, 900',
|
||||
sizes: '(max-width: 767px) 100vw, (min-width: 1120px) 28vw, 50vw',
|
||||
widths: '360, 540, 720, 900',
|
||||
sizes: '(max-width: 767px) 92vw, (min-width: 1120px) 28vw, 50vw',
|
||||
draggable: false
|
||||
}}
|
||||
</div>
|
||||
</button>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
@@ -223,6 +283,15 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if main_image %}
|
||||
<dialog class="product-lightbox" data-gallery-lightbox>
|
||||
<button type="button" class="product-lightbox__nav product-lightbox__nav--prev" data-gallery-prev aria-label="{{ 'product_page.gallery_prev' | t }}" hidden>‹</button>
|
||||
<img class="product-lightbox__image" alt="" data-gallery-image>
|
||||
<button type="button" class="product-lightbox__nav product-lightbox__nav--next" data-gallery-next aria-label="{{ 'product_page.gallery_next' | t }}" hidden>›</button>
|
||||
<button type="button" class="product-lightbox__close" data-gallery-close aria-label="{{ 'product_page.gallery_close' | t }}">×</button>
|
||||
<p class="product-lightbox__count" data-gallery-count data-template="{{ 'product_page.gallery_count' | t: current: '__C__', total: '__T__' }}" hidden></p>
|
||||
</dialog>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="product__details">
|
||||
@@ -242,7 +311,7 @@
|
||||
<p class="product__subtitle">{{ subtitle | escape }}</p>
|
||||
{% endif %}
|
||||
|
||||
{% if rating_count > 0 %}
|
||||
{% if rating_count > 0 and low_rating == false %}
|
||||
<div class="product__rating">
|
||||
<span class="product__stars" aria-hidden="true">
|
||||
{% for star in (1..5) %}
|
||||
@@ -263,7 +332,37 @@
|
||||
</p>
|
||||
|
||||
{% if excerpt != blank %}
|
||||
<p class="product__excerpt">{{ excerpt | escape }}</p>
|
||||
{% if excerpt_from_description %}
|
||||
<div class="product__excerpt" data-excerpt>
|
||||
<p class="product__excerpt-short">{{ excerpt | escape }}</p>
|
||||
{%- if excerpt_has_more -%}
|
||||
<div class="product__excerpt-full" id="ProductExcerptFull-{{ section.id }}" hidden>
|
||||
{%- for part in excerpt_parts -%}
|
||||
{%- assign part_text = part | strip -%}
|
||||
{%- if part_text != blank -%}<p>{{ part_text | escape }}</p>{%- endif -%}
|
||||
{%- endfor -%}
|
||||
</div>
|
||||
<button type="button" class="product__excerpt-toggle" aria-expanded="false" aria-controls="ProductExcerptFull-{{ section.id }}" data-more="Leer más" data-less="Leer menos">Leer más</button>
|
||||
<script nolazy>
|
||||
(function () {
|
||||
var root = document.currentScript.closest('[data-excerpt]');
|
||||
var btn = root.querySelector('.product__excerpt-toggle');
|
||||
var full = root.querySelector('.product__excerpt-full');
|
||||
var shortEl = root.querySelector('.product__excerpt-short');
|
||||
if (btn.dataset.bound) return; btn.dataset.bound = '1';
|
||||
btn.addEventListener('click', function () {
|
||||
var open = btn.getAttribute('aria-expanded') !== 'true';
|
||||
full.hidden = !open; shortEl.hidden = open;
|
||||
btn.setAttribute('aria-expanded', String(open));
|
||||
btn.textContent = open ? btn.dataset.less : btn.dataset.more;
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
{%- endif -%}
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="product__excerpt">{{ excerpt | escape }}</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% form 'product', product, id: 'product-form', class: 'product__form' %}
|
||||
@@ -315,18 +414,35 @@
|
||||
</div>
|
||||
{% endunless %}
|
||||
|
||||
<ul class="product__trust">
|
||||
<ul class="product__trust overflow-hidden">
|
||||
<li class="product__trust-row">
|
||||
<span class="product__trust-icon">{{ 'icon-marquee-shipping.svg' | inline_asset_content }}</span>
|
||||
<span>{{ 'product_page.shipping' | t }}</span>
|
||||
</li>
|
||||
<li class="product__trust-row">
|
||||
<span class="product__trust-icon">{{ 'icon-marquee-card.svg' | inline_asset_content }}</span>
|
||||
<span>{{ 'product_page.payment' | t }}</span>
|
||||
<span class="inline-flex min-w-0 items-center gap-x-2 gap-y-1">
|
||||
<span>{{ 'product_page.payment' | t }}</span>
|
||||
<span class="inline-flex flex-nowrap items-center gap-1">
|
||||
<img class="h-6 w-auto max-w-none shrink-0" src="{{ 'pay-visa.svg' | asset_url }}" alt="Visa" width="38" height="24" loading="lazy" decoding="async">
|
||||
<img class="h-6 w-auto max-w-none shrink-0" src="{{ 'pay-mastercard.svg' | asset_url }}" alt="Mastercard" width="38" height="24" loading="lazy" decoding="async">
|
||||
<img class="h-6 w-auto max-w-none shrink-0" src="{{ 'pay-amex.svg' | asset_url }}" alt="American Express" width="38" height="24" loading="lazy" decoding="async">
|
||||
<img class="h-6 w-auto max-w-none shrink-0" src="{{ 'pay-paypal.svg' | asset_url }}" alt="PayPal" width="38" height="24" loading="lazy" decoding="async">
|
||||
{{ 'apple_pay' | payment_type_svg_tag: class: 'h-6 w-auto max-w-none shrink-0' }}
|
||||
{{ 'google_pay' | payment_type_svg_tag: class: 'h-6 w-auto max-w-none shrink-0' }}
|
||||
</span>
|
||||
</span>
|
||||
</li>
|
||||
<li class="product__trust-row">
|
||||
<span class="product__trust-icon">{{ 'icon-marquee-wallet.svg' | inline_asset_content }}</span>
|
||||
<span>{{ 'product_page.installments' | t }}</span>
|
||||
<span class="inline-flex min-w-0 items-center gap-x-2 gap-y-1">
|
||||
<span>{{ 'product_page.installments_with' | t }}</span>
|
||||
<span class="inline-flex flex-nowrap items-center gap-1">
|
||||
<img class="h-6 w-auto max-w-none shrink-0" src="{{ 'pay-mercadopago.svg' | asset_url }}" alt="Mercado Pago" width="38" height="24" loading="lazy" decoding="async">
|
||||
<img class="h-6 w-auto max-w-none shrink-0" src="{{ 'pay-kueski.svg' | asset_url }}" alt="Kueski Pay" width="48" height="30" loading="lazy" decoding="async">
|
||||
<img class="h-6 w-auto max-w-none shrink-0" src="{{ 'pay-aplazo.svg' | asset_url }}" alt="Aplazo" width="48" height="30" loading="lazy" decoding="async">
|
||||
</span>
|
||||
</span>
|
||||
</li>
|
||||
<li class="product__trust-row">
|
||||
<span class="product__trust-icon">{{ 'icon-marquee-guarantee.svg' | inline_asset_content }}</span>
|
||||
@@ -334,6 +450,7 @@
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="product__subscription" data-kv-subscription-target></div>
|
||||
<div class="product__purchase">
|
||||
<div class="product__qty">
|
||||
<button type="button" data-qty="down" aria-label="{{ 'product_page.decrease' | t }}">−</button>
|
||||
@@ -360,6 +477,113 @@
|
||||
</button>
|
||||
{% endform %}
|
||||
|
||||
{% if additional_checkout_buttons %}
|
||||
<div class="product__express" data-wallets {% unless current_variant.available %}hidden{% endunless %}>
|
||||
<p class="product__express-label">{{ 'product_page.express' | t }}</p>
|
||||
{{ content_for_additional_checkout_buttons }}
|
||||
</div>
|
||||
<script nolazy>
|
||||
(() => {
|
||||
const root = document.querySelector('[data-product-page]');
|
||||
const wallets = root?.querySelector('[data-wallets]');
|
||||
const form = root?.querySelector('.product__form');
|
||||
if (!wallets || !form || wallets.dataset.bound) return;
|
||||
wallets.dataset.bound = 'true';
|
||||
|
||||
const rootPath = window.Shopify?.routes?.root || '/';
|
||||
let checkoutStarted = false;
|
||||
|
||||
const request = (url, body) => {
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open('POST', url, false);
|
||||
xhr.setRequestHeader('Accept', 'application/json');
|
||||
if (body) xhr.setRequestHeader('Content-Type', 'application/json');
|
||||
xhr.send(body || null);
|
||||
return xhr.status >= 200 && xhr.status < 300 ? xhr.responseText : '';
|
||||
};
|
||||
|
||||
const variantId = () => Number(form.querySelector('[name="id"]')?.value);
|
||||
const variantQuantity = () => Math.max(1, Number(form.querySelector('[name="quantity"]')?.value) || 1);
|
||||
|
||||
const addCurrentVariant = () => {
|
||||
checkoutStarted = true;
|
||||
const id = variantId();
|
||||
const quantity = variantQuantity();
|
||||
if (!id) return;
|
||||
try {
|
||||
const cartRequest = new XMLHttpRequest();
|
||||
cartRequest.open('GET', `${rootPath}cart.js`, false);
|
||||
cartRequest.setRequestHeader('Accept', 'application/json');
|
||||
cartRequest.send();
|
||||
const cart = cartRequest.status === 200 ? JSON.parse(cartRequest.responseText) : { items: [] };
|
||||
const already = (cart.items || []).some((item) => item.variant_id === id);
|
||||
if (already) return;
|
||||
request(`${form.action}.js`, JSON.stringify({ id, quantity }));
|
||||
} catch (error) {}
|
||||
};
|
||||
|
||||
const walletNames = (element) => {
|
||||
try {
|
||||
return JSON.parse(element?.getAttribute('wallet-configs') || '[]').map((wallet) => wallet.name);
|
||||
} catch (error) {
|
||||
return [];
|
||||
}
|
||||
};
|
||||
|
||||
const ensureGooglePay = async () => {
|
||||
const current = wallets.querySelector('shopify-accelerated-checkout-cart');
|
||||
if (!current || wallets.hidden || walletNames(current).includes('google_pay')) return;
|
||||
const id = variantId();
|
||||
if (!id) return;
|
||||
|
||||
let lineKey = '';
|
||||
try {
|
||||
const addedResponse = await fetch(`${form.action}.js`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json', Accept: 'application/json' },
|
||||
body: JSON.stringify({ id, quantity: variantQuantity() }),
|
||||
});
|
||||
if (!addedResponse.ok) return;
|
||||
const added = await addedResponse.json();
|
||||
lineKey = added.key || added.items?.find((item) => item.variant_id === id)?.key || '';
|
||||
const sectionId = root.closest('[id^="shopify-section"]')?.id?.replace('shopify-section-', '');
|
||||
const html = await fetch(`${window.location.pathname}?section_id=${encodeURIComponent(sectionId || '')}`, {
|
||||
cache: 'no-store',
|
||||
headers: { Accept: 'text/html' },
|
||||
}).then((response) => response.text());
|
||||
const next = new DOMParser().parseFromString(html, 'text/html').querySelector('shopify-accelerated-checkout-cart');
|
||||
if (!next || !walletNames(next).includes('google_pay')) return;
|
||||
current.replaceWith(next);
|
||||
await new Promise((resolve) => {
|
||||
const started = Date.now();
|
||||
const waitForButton = () => {
|
||||
if (wallets.querySelector('shopify-google-pay-button') || Date.now() - started > 8000) resolve();
|
||||
else window.setTimeout(waitForButton, 200);
|
||||
};
|
||||
waitForButton();
|
||||
});
|
||||
} catch (error) {
|
||||
} finally {
|
||||
if (lineKey && !checkoutStarted) {
|
||||
await fetch(`${rootPath}cart/change.js`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json', Accept: 'application/json' },
|
||||
body: JSON.stringify({ id: lineKey, quantity: 0 }),
|
||||
}).catch(() => {});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
wallets.addEventListener('pointerdown', addCurrentVariant);
|
||||
window.addEventListener('blur', () => {
|
||||
const active = document.activeElement;
|
||||
if (active && wallets.contains(active)) addCurrentVariant();
|
||||
});
|
||||
ensureGooglePay();
|
||||
})();
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
{% liquid
|
||||
assign sticky_image = current_variant.image
|
||||
if sticky_image == blank and current_variant.featured_media
|
||||
@@ -413,6 +637,51 @@
|
||||
document.body.appendChild(bar);
|
||||
})();
|
||||
</script>
|
||||
<script nolazy>
|
||||
// Subscription apps (Konvertti Addons) inject their purchase-options widget next to the
|
||||
// add-to-cart button. Keep the layout: widget on its own row above [qty | Añadir], "Comprar" below,
|
||||
// and mirror the chosen option's price in the sticky footer bar.
|
||||
(function () {
|
||||
if (window.__seasonPurchaseOptions) return;
|
||||
window.__seasonPurchaseOptions = true;
|
||||
var WIDGETS = '.kv-sub, [data-kv-subscription]';
|
||||
var tidy = function () {
|
||||
var row = document.querySelector('#product-form .product__purchase');
|
||||
if (!row) return;
|
||||
row.querySelectorAll(WIDGETS).forEach(function (w) {
|
||||
var node = w.closest('.shopify-block') && row.contains(w.closest('.shopify-block')) ? w.closest('.shopify-block') : w;
|
||||
if (node.parentElement === row) row.parentElement.insertBefore(node, row);
|
||||
});
|
||||
};
|
||||
var priceText = function (el) {
|
||||
if (!el) return '';
|
||||
var m = (el.textContent || '').match(/[$€£]\s?[\d.,]+|[\d.,]+\s?[$€£]/);
|
||||
return m ? m[0].trim() : '';
|
||||
};
|
||||
var syncSticky = function () {
|
||||
var sticky = document.querySelector('[data-sticky-price]');
|
||||
var checked = document.querySelector('.kv-sub input[type="radio"]:checked');
|
||||
if (!sticky || !checked) return;
|
||||
var label = checked.closest('.kv-sub__option');
|
||||
var price = priceText(label && label.querySelector('.kv-sub__price'));
|
||||
if (price) sticky.textContent = price;
|
||||
};
|
||||
var run = function () { tidy(); syncSticky(); };
|
||||
document.addEventListener('change', function (e) { if (e.target.closest && e.target.closest('.kv-sub')) window.setTimeout(run, 0); });
|
||||
document.addEventListener('kv:plan-change', function () { window.setTimeout(run, 0); });
|
||||
document.addEventListener('click', function (e) { if (e.target.closest && e.target.closest('.kv-sub, [data-variant-option], .product__variant')) window.setTimeout(run, 50); });
|
||||
var start = function () {
|
||||
run();
|
||||
var form = document.getElementById('product-form');
|
||||
if (form && 'MutationObserver' in window) {
|
||||
var t = 0;
|
||||
new MutationObserver(function () { window.clearTimeout(t); t = window.setTimeout(run, 30); })
|
||||
.observe(form.parentElement || form, { childList: true, subtree: true, characterData: true });
|
||||
}
|
||||
};
|
||||
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start); else start();
|
||||
})();
|
||||
</script>
|
||||
|
||||
<button
|
||||
class="product__favorite"
|
||||
@@ -421,9 +690,6 @@
|
||||
data-product-id="{{ product.id }}"
|
||||
data-product-handle="{{ product.handle }}"
|
||||
aria-pressed="false"
|
||||
aria-label="{{ 'bestsellers.save' | t: product: product.title }}"
|
||||
data-label-save="{{ 'bestsellers.save' | t: product: product.title }}"
|
||||
data-label-saved="{{ 'bestsellers.saved' | t: product: product.title }}"
|
||||
>
|
||||
<svg width="22" height="22" viewBox="0 0 25 25" aria-hidden="true" focusable="false">
|
||||
<path d="M17.2324 3.90625C14.0625 3.90625 12.5 7.03125 12.5 7.03125C12.5 7.03125 10.9375 3.90625 7.76758 3.90625C5.19141 3.90625 3.15137 6.06152 3.125 8.6333C3.07129 13.9717 7.35986 17.7681 12.0605 20.9585C12.1901 21.0467 12.3433 21.0938 12.5 21.0938C12.6567 21.0938 12.8099 21.0467 12.9395 20.9585C17.6396 17.7681 21.9282 13.9717 21.875 8.6333C21.8486 6.06152 19.8086 3.90625 17.2324 3.90625Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
@@ -547,7 +813,7 @@
|
||||
{% if also_shown < 4 and item.id != blank and item.id != product.id %}
|
||||
{% unless routine_ids contains item_token %}
|
||||
{% assign also_key = 'also-' | append: item.id %}
|
||||
{% render 'collection-card', product: item, form_suffix: also_key %}
|
||||
{% render 'collection-card', product: item, form_suffix: also_key, badge_mode: 'collection' %}
|
||||
{% assign also_shown = also_shown | plus: 1 %}
|
||||
{% endunless %}
|
||||
{% endif %}
|
||||
@@ -575,6 +841,8 @@
|
||||
data-product-handle="{{ product.handle | escape }}"
|
||||
data-shop="{{ shop.permanent_domain | escape }}"
|
||||
data-reviews-shop="{{ section.settings.reviews_shop | escape }}"
|
||||
data-min-rating="{{ reviews_min_rating }}"
|
||||
data-product-image="{% if product.featured_image %}https:{{ product.featured_image | image_url: width: 96 }}{% endif %}"
|
||||
data-reviews-storefront="{{ section.settings.reviews_storefront | escape }}"
|
||||
>
|
||||
<div class="product__reviews-head">
|
||||
@@ -687,7 +955,7 @@
|
||||
|
||||
const applyWish = () => {
|
||||
const saved = readWishlist().map((item) => item.id);
|
||||
root.querySelectorAll('[data-product-wish]').forEach((button) => {
|
||||
root.querySelectorAll('[data-product-wish], [data-wishlist]').forEach((button) => {
|
||||
const active = saved.includes(String(button.dataset.productId));
|
||||
button.classList.toggle('is-active', active);
|
||||
button.setAttribute('aria-pressed', active ? 'true' : 'false');
|
||||
@@ -709,29 +977,85 @@
|
||||
});
|
||||
|
||||
const thumbs = root.querySelector('[data-product-thumbs]');
|
||||
const lightbox = root.querySelector('[data-gallery-lightbox]');
|
||||
const lightboxImage = lightbox ? lightbox.querySelector('[data-gallery-image]') : null;
|
||||
const gallerySlides = () => {
|
||||
const seen = new Set();
|
||||
const slides = [];
|
||||
root.querySelectorAll('[data-gallery-open]').forEach((button) => {
|
||||
const src = button.getAttribute('data-full');
|
||||
if (!src || seen.has(src)) return;
|
||||
seen.add(src);
|
||||
const image = button.querySelector('img');
|
||||
slides.push({ src, alt: image ? image.alt : '' });
|
||||
});
|
||||
return slides;
|
||||
};
|
||||
let slides = [];
|
||||
let slideIndex = 0;
|
||||
const showSlide = (next) => {
|
||||
if (!lightbox || !lightboxImage || !slides.length) return;
|
||||
slideIndex = (next + slides.length) % slides.length;
|
||||
const slide = slides[slideIndex];
|
||||
lightboxImage.src = slide.src;
|
||||
lightboxImage.alt = slide.alt;
|
||||
const count = lightbox.querySelector('[data-gallery-count]');
|
||||
const multiple = slides.length > 1;
|
||||
if (count) {
|
||||
count.hidden = !multiple;
|
||||
const template = count.getAttribute('data-template') || '';
|
||||
count.textContent = template.replace('__C__', String(slideIndex + 1)).replace('__T__', String(slides.length));
|
||||
}
|
||||
lightbox.querySelectorAll('[data-gallery-prev], [data-gallery-next]').forEach((button) => {
|
||||
button.hidden = !multiple;
|
||||
});
|
||||
};
|
||||
const openLightbox = (button) => {
|
||||
if (!button || !lightbox || !lightboxImage) return;
|
||||
const full = button.getAttribute('data-full');
|
||||
if (!full) return;
|
||||
slides = gallerySlides();
|
||||
const start = Math.max(0, slides.findIndex((slide) => slide.src === full));
|
||||
showSlide(start);
|
||||
if (!lightbox.open) lightbox.showModal();
|
||||
};
|
||||
if (thumbs) {
|
||||
let pointerId = null;
|
||||
let startX = 0;
|
||||
let startScroll = 0;
|
||||
let dragged = false;
|
||||
let pending = null;
|
||||
|
||||
thumbs.addEventListener('pointerdown', (event) => {
|
||||
if (event.pointerType !== 'mouse' || event.button !== 0) return;
|
||||
if (event.pointerType === 'mouse' && event.button !== 0) return;
|
||||
pointerId = event.pointerId;
|
||||
startX = event.clientX;
|
||||
startScroll = thumbs.scrollLeft;
|
||||
thumbs.classList.add('is-dragging');
|
||||
thumbs.setPointerCapture(pointerId);
|
||||
dragged = false;
|
||||
pending = event.target.closest('[data-gallery-open]');
|
||||
});
|
||||
|
||||
thumbs.addEventListener('pointermove', (event) => {
|
||||
if (event.pointerId !== pointerId) return;
|
||||
thumbs.scrollLeft = startScroll - (event.clientX - startX);
|
||||
const delta = event.clientX - startX;
|
||||
if (Math.abs(delta) > 8) {
|
||||
dragged = true;
|
||||
if (!thumbs.classList.contains('is-dragging')) {
|
||||
thumbs.classList.add('is-dragging');
|
||||
thumbs.setPointerCapture(pointerId);
|
||||
}
|
||||
thumbs.scrollLeft = startScroll - delta;
|
||||
}
|
||||
});
|
||||
|
||||
const endDrag = (event) => {
|
||||
if (event.pointerId !== pointerId) return;
|
||||
const button = pending;
|
||||
pointerId = null;
|
||||
pending = null;
|
||||
thumbs.classList.remove('is-dragging');
|
||||
if (event.type === 'pointercancel' || dragged) return;
|
||||
openLightbox(button);
|
||||
};
|
||||
|
||||
thumbs.addEventListener('pointerup', endDrag);
|
||||
@@ -750,12 +1074,88 @@
|
||||
thumbs.addEventListener('scroll', syncProgress, { passive: true });
|
||||
window.addEventListener('resize', syncProgress);
|
||||
syncProgress();
|
||||
|
||||
thumbs.addEventListener('click', (event) => {
|
||||
if (dragged) return;
|
||||
openLightbox(event.target.closest('[data-gallery-open]'));
|
||||
});
|
||||
}
|
||||
|
||||
const mainImage = root.querySelector('.product__main[data-gallery-open]');
|
||||
if (mainImage) {
|
||||
mainImage.addEventListener('click', () => openLightbox(mainImage));
|
||||
}
|
||||
|
||||
if (lightbox && lightboxImage) {
|
||||
let swipeX = null;
|
||||
let swiped = false;
|
||||
lightbox.addEventListener('click', (event) => {
|
||||
if (event.target.closest('[data-gallery-close]')) {
|
||||
lightbox.close();
|
||||
return;
|
||||
}
|
||||
if (event.target.closest('[data-gallery-prev]')) {
|
||||
showSlide(slideIndex - 1);
|
||||
return;
|
||||
}
|
||||
if (event.target.closest('[data-gallery-next]')) {
|
||||
showSlide(slideIndex + 1);
|
||||
return;
|
||||
}
|
||||
if (swiped) {
|
||||
swiped = false;
|
||||
return;
|
||||
}
|
||||
const rect = lightbox.getBoundingClientRect();
|
||||
const inside = event.clientX >= rect.left && event.clientX <= rect.right && event.clientY >= rect.top && event.clientY <= rect.bottom;
|
||||
if (!inside) lightbox.close();
|
||||
});
|
||||
lightbox.addEventListener('keydown', (event) => {
|
||||
if (event.key === 'ArrowLeft') {
|
||||
event.preventDefault();
|
||||
showSlide(slideIndex - 1);
|
||||
}
|
||||
if (event.key === 'ArrowRight') {
|
||||
event.preventDefault();
|
||||
showSlide(slideIndex + 1);
|
||||
}
|
||||
});
|
||||
lightbox.addEventListener('pointerdown', (event) => {
|
||||
if (event.target !== lightboxImage) return;
|
||||
swipeX = event.clientX;
|
||||
swiped = false;
|
||||
});
|
||||
lightbox.addEventListener('pointerup', (event) => {
|
||||
if (swipeX == null || event.target !== lightboxImage) return;
|
||||
const delta = event.clientX - swipeX;
|
||||
swipeX = null;
|
||||
if (Math.abs(delta) < 40) return;
|
||||
swiped = true;
|
||||
showSlide(slideIndex + (delta < 0 ? 1 : -1));
|
||||
});
|
||||
lightbox.addEventListener('close', () => {
|
||||
lightboxImage.removeAttribute('src');
|
||||
});
|
||||
}
|
||||
|
||||
const form = root.querySelector('.product__form');
|
||||
const qtyInput = root.querySelector('[data-qty-input]');
|
||||
|
||||
root.addEventListener('click', (event) => {
|
||||
const wishCard = event.target.closest('[data-wishlist]');
|
||||
if (wishCard && root.contains(wishCard)) {
|
||||
const id = String(wishCard.dataset.productId || '');
|
||||
const cardHandle = String(wishCard.dataset.productHandle || '');
|
||||
if (!id) return;
|
||||
const saved = readWishlist();
|
||||
const next = saved.some((item) => item.id === id)
|
||||
? saved.filter((item) => item.id !== id)
|
||||
: saved.concat({ id, handle: cardHandle });
|
||||
writeWishlist(next);
|
||||
applyWish();
|
||||
return;
|
||||
}
|
||||
|
||||
const wish = event.target.closest('[data-product-wish]');
|
||||
if (wish && root.contains(wish)) {
|
||||
const id = String(wish.dataset.productId || '');
|
||||
@@ -783,7 +1183,10 @@
|
||||
node.classList.toggle('is-selected', node === option);
|
||||
});
|
||||
const idInput = form?.querySelector('[name="id"]');
|
||||
if (idInput) idInput.value = option.dataset.id || idInput.value;
|
||||
if (idInput) {
|
||||
idInput.value = option.dataset.id || idInput.value;
|
||||
idInput.dispatchEvent(new Event('change', { bubbles: true }));
|
||||
}
|
||||
const price = root.querySelector('[data-price]');
|
||||
if (price) price.textContent = option.dataset.price || '';
|
||||
const compare = root.querySelector('[data-compare]');
|
||||
@@ -816,10 +1219,16 @@
|
||||
}
|
||||
if (stickyPrice) stickyPrice.textContent = option.dataset.price || '';
|
||||
if (buyButton) buyButton.disabled = !available;
|
||||
const wallets = root.querySelector('[data-wallets]');
|
||||
if (wallets) wallets.hidden = !available;
|
||||
const main = root.querySelector('[data-main-image]');
|
||||
if (main && option.dataset.image) {
|
||||
main.removeAttribute('srcset');
|
||||
main.src = option.dataset.image;
|
||||
const mainButton = main.closest('[data-gallery-open]');
|
||||
if (mainButton) mainButton.setAttribute('data-full', option.dataset.image);
|
||||
const twin = root.querySelector('.product__thumb--main[data-gallery-open]');
|
||||
if (twin) twin.setAttribute('data-full', option.dataset.image);
|
||||
}
|
||||
const stickyImage = root.querySelector('[data-sticky-image]');
|
||||
if (stickyImage && option.dataset.image) {
|
||||
@@ -828,6 +1237,48 @@
|
||||
}
|
||||
});
|
||||
|
||||
root.addEventListener('submit', async (event) => {
|
||||
const cardForm = event.target;
|
||||
if (!(cardForm instanceof HTMLFormElement) || !cardForm.hasAttribute('data-collection-card') || !root.contains(cardForm)) return;
|
||||
event.preventDefault();
|
||||
const button = event.submitter instanceof HTMLButtonElement ? event.submitter : cardForm.querySelector('[type="submit"]');
|
||||
const variantId = cardForm.querySelector('[name="id"]')?.value;
|
||||
if (!button || button.disabled || !variantId) return;
|
||||
const buttons = [...cardForm.querySelectorAll('button')];
|
||||
buttons.forEach((item) => {
|
||||
item.disabled = true;
|
||||
});
|
||||
const buyNow = button.hasAttribute('data-buy');
|
||||
try {
|
||||
const addResponse = await fetch(`${cardForm.action}.js`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Accept: 'application/json',
|
||||
},
|
||||
body: JSON.stringify({ id: Number(variantId), quantity: 1 }),
|
||||
});
|
||||
if (!addResponse.ok) {
|
||||
cardForm.submit();
|
||||
return;
|
||||
}
|
||||
if (buyNow) {
|
||||
const base = (root.dataset.root || '/').replace(/\/?$/, '/');
|
||||
window.location.href = `${base}checkout`;
|
||||
return;
|
||||
}
|
||||
document.dispatchEvent(new CustomEvent('season:cart:open'));
|
||||
} catch (error) {
|
||||
cardForm.submit();
|
||||
} finally {
|
||||
if (!buyNow) {
|
||||
buttons.forEach((item) => {
|
||||
item.disabled = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
form?.addEventListener('submit', async (event) => {
|
||||
const submitter = event.submitter;
|
||||
if (!(submitter instanceof HTMLButtonElement) || !submitter.hasAttribute('data-buy')) return;
|
||||
@@ -906,6 +1357,7 @@
|
||||
list.replaceChildren(...nodes);
|
||||
block.hidden = false;
|
||||
block.dataset.filled = 'true';
|
||||
applyWish();
|
||||
} catch (error) {
|
||||
block.hidden = true;
|
||||
}
|
||||
@@ -936,7 +1388,15 @@
|
||||
return (parsed.body.textContent || '').trim();
|
||||
};
|
||||
|
||||
const renderReviews = (reviews, append) => {
|
||||
const avatarIcon = '<svg width="24" height="24" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="8" r="3.25" stroke="currentColor" stroke-width="1.4"/><path d="M5.2 19.4c1.15-3.15 3.35-4.7 6.8-4.7s5.65 1.55 6.8 4.7" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/></svg>';
|
||||
const pictureUrl = (pic) => {
|
||||
if (!pic) return '';
|
||||
if (typeof pic === 'string') return pic;
|
||||
return (pic.urls && (pic.urls.compact || pic.urls.small || pic.urls.original)) || pic.compact || pic.small || pic.original || '';
|
||||
};
|
||||
const fallbackProductImage = reviewsRoot.dataset.productImage || '';
|
||||
|
||||
const renderReviews = (reviews, append, data) => {
|
||||
if (!append) list.replaceChildren();
|
||||
reviews.forEach((review) => {
|
||||
const rating = Math.max(1, Math.min(5, Math.round(Number(review.rating) || 0)));
|
||||
@@ -966,7 +1426,21 @@
|
||||
const avatar = document.createElement('span');
|
||||
avatar.className = 'product__avatar';
|
||||
avatar.setAttribute('aria-hidden', 'true');
|
||||
avatar.innerHTML = '<svg width="24" height="24" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="8" r="3.25" stroke="currentColor" stroke-width="1.4"/><path d="M5.2 19.4c1.15-3.15 3.35-4.7 6.8-4.7s5.65 1.55 6.8 4.7" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/></svg>';
|
||||
const avatarUrl = review.avatar_image_url || (review.gravatar_hash ? 'https://www.gravatar.com/avatar/' + review.gravatar_hash + '?s=96&d=404' : '');
|
||||
if (avatarUrl) {
|
||||
const avatarImg = document.createElement('img');
|
||||
avatarImg.className = 'product__avatar-img';
|
||||
avatarImg.src = avatarUrl;
|
||||
avatarImg.alt = '';
|
||||
avatarImg.width = 48;
|
||||
avatarImg.height = 48;
|
||||
avatarImg.loading = 'lazy';
|
||||
avatarImg.decoding = 'async';
|
||||
avatarImg.addEventListener('error', () => { avatar.innerHTML = avatarIcon; }, { once: true });
|
||||
avatar.append(avatarImg);
|
||||
} else {
|
||||
avatar.innerHTML = avatarIcon;
|
||||
}
|
||||
const name = document.createElement('p');
|
||||
name.className = 'product__review-name';
|
||||
name.textContent = review.reviewer_name || 'Cliente';
|
||||
@@ -978,6 +1452,33 @@
|
||||
text.textContent = body || review.title || '';
|
||||
|
||||
article.append(stars, person, text);
|
||||
|
||||
const photos = (review.pictures_urls || []).map(pictureUrl).filter(Boolean);
|
||||
if (photos.length) {
|
||||
const gallery = document.createElement('div');
|
||||
gallery.className = 'product__review-photos';
|
||||
photos.slice(0, 4).forEach((src) => {
|
||||
const img = document.createElement('img');
|
||||
img.src = src; img.alt = 'Foto de ' + (review.reviewer_name || 'cliente');
|
||||
img.width = 64; img.height = 64; img.loading = 'lazy'; img.decoding = 'async';
|
||||
gallery.append(img);
|
||||
});
|
||||
article.append(gallery);
|
||||
}
|
||||
|
||||
const productImage = review.product_variant_image_url || (data && data.image_url) || fallbackProductImage;
|
||||
if (productImage) {
|
||||
const productRow = document.createElement('div');
|
||||
productRow.className = 'product__review-product';
|
||||
const thumb = document.createElement('img');
|
||||
thumb.src = productImage + (productImage.includes('?') ? '&' : '?') + 'width=96';
|
||||
thumb.alt = '';
|
||||
thumb.width = 40; thumb.height = 40; thumb.loading = 'lazy'; thumb.decoding = 'async';
|
||||
const label = document.createElement('span');
|
||||
label.textContent = review.product_title || (data && data.product_name) || '';
|
||||
productRow.append(thumb, label);
|
||||
article.append(productRow);
|
||||
}
|
||||
list.append(article);
|
||||
});
|
||||
};
|
||||
@@ -1006,7 +1507,11 @@
|
||||
cache.set(page, await response.json());
|
||||
}
|
||||
const data = cache.get(page);
|
||||
renderReviews(data.reviews || [], append);
|
||||
if (page === 1 && Number(data.number_of_reviews) > 0 && Number(data.average_rating) < (Number(reviewsRoot.dataset.minRating) || 0)) {
|
||||
reviewsRoot.hidden = true;
|
||||
return;
|
||||
}
|
||||
renderReviews(data.reviews || [], append, data);
|
||||
updateMore(page, data.pagination ? data.pagination.total_pages : 1);
|
||||
} finally {
|
||||
loading = false;
|
||||
@@ -1087,6 +1592,16 @@
|
||||
"type": "paragraph",
|
||||
"content": "t:product_page.metafields"
|
||||
},
|
||||
{
|
||||
"type": "range",
|
||||
"id": "reviews_min_rating",
|
||||
"label": "Calificación mínima para mostrar reseñas",
|
||||
"info": "Si el promedio del producto es menor, se ocultan las reseñas y las estrellas. 0 = mostrar siempre.",
|
||||
"min": 0,
|
||||
"max": 5,
|
||||
"step": 0.1,
|
||||
"default": 3.5
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"id": "reviews_shop",
|
||||
@@ -1103,7 +1618,10 @@
|
||||
}
|
||||
],
|
||||
"disabled_on": {
|
||||
"groups": ["header", "footer"]
|
||||
"groups": [
|
||||
"header",
|
||||
"footer"
|
||||
]
|
||||
}
|
||||
}
|
||||
{% endschema %}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
{% if collection != blank %}
|
||||
{% for product in collection.products limit: 4 %}
|
||||
{% assign card_suffix = section.id | append: '-recent-' | append: forloop.index %}
|
||||
{% render 'collection-card', product: product, form_suffix: card_suffix %}
|
||||
{% render 'collection-card', product: product, form_suffix: card_suffix, badge_mode: 'collection' %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@@ -6,10 +6,11 @@
|
||||
endif
|
||||
|
||||
if section.settings.cover_link != blank
|
||||
assign cover_tag = 'a'
|
||||
assign cover_href = section.settings.cover_link
|
||||
else
|
||||
assign cover_tag = 'div'
|
||||
assign cover_href = '/collections/kits-skincare-facial'
|
||||
endif
|
||||
assign cover_tag = 'a'
|
||||
%}
|
||||
|
||||
<section class="routine full-width">
|
||||
@@ -17,7 +18,7 @@
|
||||
<{{ cover_tag }}
|
||||
class="routine__cover"
|
||||
{% if cover_tag == 'a' %}
|
||||
href="{{ section.settings.cover_link }}"
|
||||
href="{{ cover_href }}"
|
||||
{% endif %}
|
||||
>
|
||||
{% if section.settings.cover_image != blank %}
|
||||
@@ -47,7 +48,8 @@
|
||||
<h2 class="routine__heading">{{ heading | escape | newline_to_br }}</h2>
|
||||
</{{ cover_tag }}>
|
||||
|
||||
<div class="routine__steps">
|
||||
<div class="routine__steps" data-routine-viewport>
|
||||
<div class="routine__track" data-routine-track>
|
||||
{% for block in section.blocks %}
|
||||
{% liquid
|
||||
if block.settings.title != blank
|
||||
@@ -140,10 +142,119 @@
|
||||
<p class="routine__empty">{{ 'routine.empty' | t }}</p>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="routine__progress" aria-hidden="true">
|
||||
<span class="routine__progress-bar" data-routine-bar></span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<script nolazy>
|
||||
(() => {
|
||||
const sliderQuery = window.matchMedia('(max-width: 1024px)');
|
||||
const phoneQuery = window.matchMedia('(max-width: 767px)');
|
||||
const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)');
|
||||
|
||||
const strideOf = (viewport) => {
|
||||
const card = viewport.querySelector('.routine__card');
|
||||
const track = viewport.querySelector('[data-routine-track]');
|
||||
if (!card) return 0;
|
||||
const gap = track ? parseFloat(window.getComputedStyle(track).columnGap) || 0 : 0;
|
||||
return card.getBoundingClientRect().width + gap;
|
||||
};
|
||||
|
||||
const updateProgress = (viewport) => {
|
||||
const section = viewport.closest('.routine');
|
||||
const bar = section && section.querySelector('[data-routine-bar]');
|
||||
if (!bar) return;
|
||||
const max = viewport.scrollWidth - viewport.clientWidth;
|
||||
const visible = viewport.scrollWidth > 0 ? viewport.clientWidth / viewport.scrollWidth : 1;
|
||||
const width = Math.min(Math.max(visible * 100, 12), 100);
|
||||
const travel = 100 - width;
|
||||
const progress = max <= 2 ? 0 : viewport.scrollLeft / max;
|
||||
bar.style.width = `${width}%`;
|
||||
bar.style.left = `${progress * travel}%`;
|
||||
};
|
||||
|
||||
const goTo = (viewport, index, behavior) => {
|
||||
const stride = strideOf(viewport);
|
||||
const count = viewport.querySelectorAll('.routine__card').length;
|
||||
if (!stride || !count) return;
|
||||
const wrapped = ((index % count) + count) % count;
|
||||
const max = Math.max(viewport.scrollWidth - viewport.clientWidth, 0);
|
||||
viewport.scrollTo({ left: Math.min(wrapped * stride, max), behavior });
|
||||
};
|
||||
|
||||
const boot = (section) => {
|
||||
const viewport = section.querySelector('[data-routine-viewport]');
|
||||
if (!viewport || viewport.dataset.ready === 'true') return;
|
||||
viewport.dataset.ready = 'true';
|
||||
|
||||
const pause = () => {
|
||||
if (viewport._routineTimer) window.clearInterval(viewport._routineTimer);
|
||||
viewport._routineTimer = null;
|
||||
};
|
||||
|
||||
const play = () => {
|
||||
pause();
|
||||
if (!sliderQuery.matches || reduceMotion.matches || viewport.dataset.paused === 'true') return;
|
||||
viewport._routineTimer = window.setInterval(() => {
|
||||
const max = viewport.scrollWidth - viewport.clientWidth;
|
||||
if (max <= 2) return;
|
||||
const stride = strideOf(viewport);
|
||||
const count = viewport.querySelectorAll('.routine__card').length;
|
||||
if (!stride || count < 2) return;
|
||||
const index = Math.round(viewport.scrollLeft / stride);
|
||||
const behavior = reduceMotion.matches ? 'auto' : 'smooth';
|
||||
goTo(viewport, index + 1 >= count ? 0 : index + 1, behavior);
|
||||
}, 4000);
|
||||
};
|
||||
|
||||
if (phoneQuery.matches) goTo(viewport, 0, 'auto');
|
||||
updateProgress(viewport);
|
||||
play();
|
||||
|
||||
viewport.addEventListener('scroll', () => updateProgress(viewport), { passive: true });
|
||||
viewport.addEventListener('pointerdown', () => {
|
||||
viewport.dataset.paused = 'true';
|
||||
pause();
|
||||
});
|
||||
viewport.addEventListener('pointerup', () => {
|
||||
window.setTimeout(() => {
|
||||
delete viewport.dataset.paused;
|
||||
play();
|
||||
}, 2500);
|
||||
});
|
||||
viewport.addEventListener('pointercancel', () => {
|
||||
delete viewport.dataset.paused;
|
||||
play();
|
||||
});
|
||||
|
||||
const onChange = () => {
|
||||
if (phoneQuery.matches) {
|
||||
const stride = strideOf(viewport);
|
||||
const index = stride ? Math.round(viewport.scrollLeft / stride) : 0;
|
||||
goTo(viewport, index, 'auto');
|
||||
}
|
||||
updateProgress(viewport);
|
||||
play();
|
||||
};
|
||||
sliderQuery.addEventListener('change', onChange);
|
||||
phoneQuery.addEventListener('change', onChange);
|
||||
window.addEventListener('resize', onChange);
|
||||
};
|
||||
|
||||
document.querySelectorAll('.routine').forEach(boot);
|
||||
if (window.__seasonRoutine) return;
|
||||
window.__seasonRoutine = true;
|
||||
document.addEventListener('shopify:section:load', (event) => {
|
||||
const section = event.target.querySelector('.routine');
|
||||
if (section) boot(section);
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
{% schema %}
|
||||
{
|
||||
"name": "t:routine.name",
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
endif
|
||||
%}
|
||||
|
||||
<section class="search-page full-width">
|
||||
<section class="search-page full-width" data-collection>
|
||||
<div class="search-page__body">
|
||||
<h1 class="search-page__title">{{ search_heading | escape }}</h1>
|
||||
|
||||
@@ -31,6 +31,24 @@
|
||||
<p class="search-page__empty">{{ 'search.no_results_html' | t: terms: search_heading }}</p>
|
||||
{% else %}
|
||||
<p class="search-page__count">{{ 'search.results_for_html' | t: terms: search_heading, count: search.results_count }}</p>
|
||||
{%- liquid
|
||||
assign search_sort = search.sort_by | default: search.default_sort_by
|
||||
assign search_clear = routes.search_url | append: '?q=' | append: search.terms
|
||||
assign search_type = ''
|
||||
if search.types.size == 1
|
||||
assign search_type = search.types | first
|
||||
endif
|
||||
-%}
|
||||
{% render 'facets-toolbar',
|
||||
filters: search.filters,
|
||||
sort_options: search.sort_options,
|
||||
current_sort: search_sort,
|
||||
action_url: routes.search_url,
|
||||
clear_url: search_clear,
|
||||
count_label: '',
|
||||
results_type: search_type,
|
||||
terms: search.terms
|
||||
%}
|
||||
|
||||
{% paginate search.results by 9 %}
|
||||
<div class="search-page__grid">
|
||||
|
||||
@@ -33,6 +33,10 @@
|
||||
assign jar_alt = 'skin_match.photos.jar' | t
|
||||
assign dropper_alt = 'skin_match.photos.dropper' | t
|
||||
assign cheek_alt = 'skin_match.photos.cheek' | t
|
||||
assign serum_url = '/collections/hidratantes'
|
||||
assign dropper_url = '/collections/serum'
|
||||
assign cheek_url = '/collections/hidratacion'
|
||||
assign jar_url = '/collections/2-trata'
|
||||
%}
|
||||
|
||||
<section class="skin-match full-width">
|
||||
@@ -87,7 +91,7 @@
|
||||
</header>
|
||||
|
||||
<div class="skin-match__gallery">
|
||||
<div class="skin-match__photo skin-match__photo--serum">
|
||||
<a class="skin-match__photo skin-match__photo--serum" href="{{ serum_url }}">
|
||||
{% if section.settings.image_serum != blank %}
|
||||
{{
|
||||
section.settings.image_serum
|
||||
@@ -112,9 +116,9 @@
|
||||
decoding="async"
|
||||
>
|
||||
{% endif %}
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<div class="skin-match__photo skin-match__photo--dropper">
|
||||
<a class="skin-match__photo skin-match__photo--dropper" href="{{ dropper_url }}">
|
||||
{% if section.settings.image_dropper != blank %}
|
||||
{{
|
||||
section.settings.image_dropper
|
||||
@@ -139,9 +143,9 @@
|
||||
decoding="async"
|
||||
>
|
||||
{% endif %}
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<div class="skin-match__photo skin-match__photo--cheek">
|
||||
<a class="skin-match__photo skin-match__photo--cheek" href="{{ cheek_url }}">
|
||||
{% if section.settings.image_cheek != blank %}
|
||||
{{
|
||||
section.settings.image_cheek
|
||||
@@ -166,9 +170,9 @@
|
||||
decoding="async"
|
||||
>
|
||||
{% endif %}
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<div class="skin-match__photo skin-match__photo--jar">
|
||||
<a class="skin-match__photo skin-match__photo--jar" href="{{ jar_url }}">
|
||||
{% if section.settings.image_jar != blank %}
|
||||
{{
|
||||
section.settings.image_jar
|
||||
@@ -193,7 +197,7 @@
|
||||
decoding="async"
|
||||
>
|
||||
{% endif %}
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<p class="skin-match__body">
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{% doc %}
|
||||
Renders one product card for the best sellers slider.
|
||||
Sold-out products are skipped so the card can always be added or bought.
|
||||
|
||||
@param {product} product - Product to display
|
||||
@param {string} [form_suffix] - Suffix that keeps the add-to-cart form id unique
|
||||
@@ -8,6 +9,7 @@
|
||||
{% render 'bestsellers-card', product: product, form_suffix: section.id %}
|
||||
{% enddoc %}
|
||||
|
||||
{% if product.available %}
|
||||
{% liquid
|
||||
assign variant = product.selected_or_first_available_variant
|
||||
assign card_image = product.featured_image
|
||||
@@ -27,29 +29,12 @@
|
||||
if subtitle == blank and variant.title != 'Default Title'
|
||||
assign subtitle = variant.title
|
||||
endif
|
||||
|
||||
assign skin_label = product.metafields.custom.tipo_de_piel.value | default: product.metafields.custom.tipo_de_piel
|
||||
if skin_label == blank
|
||||
assign skin_label = product.metafields.custom.skin_type.value | default: product.metafields.custom.skin_type
|
||||
endif
|
||||
if skin_label == blank
|
||||
assign skin_fallback = blank
|
||||
for tag in product.tags
|
||||
assign tag_label = tag | downcase
|
||||
if tag_label contains 'piel'
|
||||
if skin_fallback == blank
|
||||
assign skin_fallback = tag
|
||||
endif
|
||||
if tag_label contains 'pieles' or tag_label contains 'piel '
|
||||
assign skin_label = tag
|
||||
break
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
if skin_label == blank
|
||||
assign skin_label = skin_fallback
|
||||
endif
|
||||
endif
|
||||
%}
|
||||
{% capture collection_label %}
|
||||
{% render 'product-collection-label', product: product %}
|
||||
{% endcapture %}
|
||||
{% liquid
|
||||
assign collection_label = collection_label | strip
|
||||
|
||||
assign rating_value = 0
|
||||
assign rating_count = 0
|
||||
@@ -100,8 +85,8 @@
|
||||
|
||||
<div class="bestsellers__badges">
|
||||
<span class="bestsellers__badge bestsellers__badge--best">{{ 'bestsellers.badge' | t }}</span>
|
||||
{% if skin_label != blank %}
|
||||
<span class="bestsellers__badge bestsellers__badge--skin">{{ skin_label | escape }}</span>
|
||||
{% if collection_label != blank %}
|
||||
<span class="bestsellers__badge bestsellers__badge--skin">{{ collection_label | escape }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@@ -183,3 +168,4 @@
|
||||
</div>
|
||||
|
||||
</article>
|
||||
{% endif %}
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
{% doc %}
|
||||
Edge arrows for horizontal carousels (same look as the header submenu arrows).
|
||||
"Prev" only shows when there is content behind, "next" only when there is more ahead.
|
||||
Add a selector to CAROUSELS to enable it on another scroller.
|
||||
|
||||
@example
|
||||
{% render 'carousel-edge-arrows' %}
|
||||
{% enddoc %}
|
||||
<style>
|
||||
.edge-arrow{position:absolute;z-index:4;display:grid;place-items:center;width:2.25rem;height:2.25rem;margin:0;padding:0;border:0;border-radius:50%;background:#fff;color:#000;box-shadow:0 .125rem .5rem rgba(0,0,0,.18);cursor:pointer;transform:translateY(-50%);transition:opacity .2s ease;-webkit-tap-highlight-color:transparent}
|
||||
.edge-arrow[hidden]{display:none}
|
||||
.edge-arrow:active{transform:translateY(-50%) scale(.96)}
|
||||
.edge-arrow svg{display:block;width:.5rem;height:.875rem}
|
||||
.edge-arrow--prev{left:.5rem}
|
||||
.edge-arrow--prev svg{transform:rotate(180deg)}
|
||||
.edge-arrow--next{right:.5rem}
|
||||
.edge-arrow:focus-visible{outline:2px solid #000;outline-offset:2px}
|
||||
/* Mobile: cards snap to the center only after the user starts interacting (initial view stays left-aligned). */
|
||||
@media (max-width: 767px) {
|
||||
[data-edge-center="on"] .bestsellers__card,
|
||||
[data-edge-center="on"] .routine__card { scroll-snap-align: center; }
|
||||
}
|
||||
</style>
|
||||
<script nolazy>
|
||||
(function () {
|
||||
if (window.__edgeArrows) return;
|
||||
window.__edgeArrows = true;
|
||||
var CAROUSELS = '.bestsellers__viewport, .routine__steps';
|
||||
var CARDS = '.bestsellers__card, .routine__card';
|
||||
var mobileMq = window.matchMedia('(max-width: 767px)');
|
||||
var cardsOf = function (viewport) {
|
||||
return [].slice.call(viewport.querySelectorAll(CARDS)).filter(function (c) { return c.offsetParent !== null; });
|
||||
};
|
||||
var ICON = '<svg width="8" height="14" viewBox="0 0 8 14" aria-hidden="true" focusable="false"><path d="M1 1.2 6.8 7 1 12.8" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"></path></svg>';
|
||||
|
||||
var make = function (dir) {
|
||||
var b = document.createElement('button');
|
||||
b.type = 'button';
|
||||
b.className = 'edge-arrow edge-arrow--' + (dir < 0 ? 'prev' : 'next');
|
||||
b.setAttribute('aria-label', dir < 0 ? 'Ver anteriores' : 'Ver siguientes');
|
||||
b.dataset.edgeScroll = String(dir);
|
||||
b.innerHTML = ICON;
|
||||
b.hidden = true;
|
||||
return b;
|
||||
};
|
||||
|
||||
var setup = function (viewport) {
|
||||
if (viewport.dataset.edgeArrows) return;
|
||||
viewport.dataset.edgeArrows = '1';
|
||||
var host = viewport.parentElement;
|
||||
if (getComputedStyle(host).position === 'static') host.style.position = 'relative';
|
||||
var prev = make(-1), next = make(1);
|
||||
host.appendChild(prev);
|
||||
host.appendChild(next);
|
||||
|
||||
var place = function () {
|
||||
// Vertically center on the first card image (like the submenu arrows), else on the viewport.
|
||||
var img = viewport.querySelector('img');
|
||||
var hostTop = host.getBoundingClientRect().top;
|
||||
var top;
|
||||
if (img && img.getBoundingClientRect().height > 40) {
|
||||
var r = img.getBoundingClientRect();
|
||||
top = r.top - hostTop + r.height / 2;
|
||||
} else {
|
||||
var v = viewport.getBoundingClientRect();
|
||||
top = v.top - hostTop + v.height / 2;
|
||||
}
|
||||
prev.style.top = next.style.top = Math.round(top) + 'px';
|
||||
};
|
||||
// Mobile centering is armed on the first interaction only: on load the first card stays
|
||||
// left-aligned (no empty gap). After that, cards snap to the middle and the last card gets
|
||||
// trailing space so it can center too.
|
||||
var armed = false;
|
||||
var center = function () {
|
||||
var cards = cardsOf(viewport);
|
||||
cards.forEach(function (c) { c.style.marginRight = ''; });
|
||||
if (!mobileMq.matches || !cards.length || !armed) { viewport.removeAttribute('data-edge-center'); return; }
|
||||
viewport.setAttribute('data-edge-center', 'on');
|
||||
var side = Math.max(0, (viewport.clientWidth - cards[0].getBoundingClientRect().width) / 2);
|
||||
var padR = parseFloat(getComputedStyle(viewport).paddingRight) || 0;
|
||||
cards[cards.length - 1].style.marginRight = Math.max(0, side - padR) + 'px';
|
||||
};
|
||||
var arm = function () {
|
||||
if (armed || !mobileMq.matches) return;
|
||||
armed = true;
|
||||
center();
|
||||
update();
|
||||
};
|
||||
viewport.addEventListener('touchstart', arm, { passive: true, once: true });
|
||||
viewport.addEventListener('pointerdown', arm, { passive: true, once: true });
|
||||
var currentIndex = function (cards) {
|
||||
var vr = viewport.getBoundingClientRect(), mid = vr.left + vr.width / 2, best = 0, dist = Infinity;
|
||||
cards.forEach(function (c, i) {
|
||||
var r = c.getBoundingClientRect(), d = Math.abs(r.left + r.width / 2 - mid);
|
||||
if (d < dist) { dist = d; best = i; }
|
||||
});
|
||||
return best;
|
||||
};
|
||||
var goCard = function (dir) {
|
||||
var cards = cardsOf(viewport);
|
||||
if (!cards.length) return false;
|
||||
var target = cards[Math.min(cards.length - 1, Math.max(0, currentIndex(cards) + dir))];
|
||||
var vr = viewport.getBoundingClientRect(), r = target.getBoundingClientRect();
|
||||
viewport.scrollBy({ left: (r.left + r.width / 2) - (vr.left + vr.width / 2), behavior: 'smooth' });
|
||||
return true;
|
||||
};
|
||||
var update = function () {
|
||||
var max = viewport.scrollWidth - viewport.clientWidth;
|
||||
var x = Math.abs(viewport.scrollLeft);
|
||||
// Small tolerance: some carousels start with a few px of offset/padding.
|
||||
prev.hidden = !(max > 24 && x > 24);
|
||||
next.hidden = !(max > 24 && x < max - 24);
|
||||
};
|
||||
var raf = 0;
|
||||
viewport.addEventListener('scroll', function () {
|
||||
if (raf) return;
|
||||
raf = requestAnimationFrame(function () { raf = 0; update(); });
|
||||
}, { passive: true });
|
||||
window.addEventListener('resize', function () { center(); place(); update(); });
|
||||
[prev, next].forEach(function (btn) {
|
||||
btn.addEventListener('click', function () {
|
||||
var dir = Number(btn.dataset.edgeScroll);
|
||||
arm();
|
||||
if (mobileMq.matches && goCard(dir)) return;
|
||||
viewport.scrollBy({ left: dir * viewport.clientWidth * 0.8, behavior: 'smooth' });
|
||||
});
|
||||
});
|
||||
if ('ResizeObserver' in window) new ResizeObserver(function () { place(); update(); }).observe(viewport);
|
||||
viewport.querySelectorAll('img').forEach(function (img) { if (!img.complete) img.addEventListener('load', place, { once: true }); });
|
||||
center();
|
||||
place();
|
||||
update();
|
||||
};
|
||||
|
||||
var init = function () { document.querySelectorAll(CAROUSELS).forEach(setup); };
|
||||
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', init); else init();
|
||||
document.addEventListener('shopify:section:load', init);
|
||||
})();
|
||||
</script>
|
||||
@@ -0,0 +1,69 @@
|
||||
{% doc %}
|
||||
Merges duplicate cart lines (same variant, same purchase type: one-time or the same
|
||||
subscription plan) into a single line with the summed quantity. Duplicates appear when two
|
||||
"add" requests for the same product reach Shopify at the same time, or when apps add hidden
|
||||
line properties. Free-gift lines ($0 or _kv_gift) are never touched.
|
||||
Exposes window.seasonsMergeCartLines() -> Promise<boolean> (true when something was merged).
|
||||
|
||||
@example
|
||||
{% render 'cart-merge-lines' %}
|
||||
{% enddoc %}
|
||||
<script nolazy>
|
||||
(function () {
|
||||
if (window.seasonsMergeCartLines) return;
|
||||
var root = (window.Shopify && window.Shopify.routes && window.Shopify.routes.root) || '/';
|
||||
var running = null;
|
||||
var isGift = function (item) {
|
||||
var props = item.properties || {};
|
||||
return item.final_price === 0 || Object.keys(props).some(function (k) { return /gift|regalo/i.test(k); });
|
||||
};
|
||||
var visibleProps = function (item) {
|
||||
var props = item.properties || {}, out = {};
|
||||
Object.keys(props).sort().forEach(function (k) { if (k.charAt(0) !== '_') out[k] = props[k]; });
|
||||
return JSON.stringify(out);
|
||||
};
|
||||
window.seasonsMergeCartLines = function () {
|
||||
if (running) return running;
|
||||
running = fetch(root + 'cart.js', { headers: { Accept: 'application/json' } })
|
||||
.then(function (r) { return r.json(); })
|
||||
.then(function (cart) {
|
||||
var groups = {};
|
||||
(cart.items || []).forEach(function (item) {
|
||||
if (isGift(item)) return;
|
||||
var plan = item.selling_plan_allocation && item.selling_plan_allocation.selling_plan ? item.selling_plan_allocation.selling_plan.id : 'once';
|
||||
var id = item.variant_id + '|' + plan + '|' + visibleProps(item);
|
||||
(groups[id] = groups[id] || []).push(item);
|
||||
});
|
||||
var updates = {}, merged = false;
|
||||
Object.keys(groups).forEach(function (id) {
|
||||
var lines = groups[id];
|
||||
if (lines.length < 2) return;
|
||||
merged = true;
|
||||
var total = lines.reduce(function (n, l) { return n + l.quantity; }, 0);
|
||||
updates[lines[0].key] = total;
|
||||
lines.slice(1).forEach(function (l) { updates[l.key] = 0; });
|
||||
});
|
||||
if (!merged) return false;
|
||||
return fetch(root + 'cart/update.js', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json', Accept: 'application/json' },
|
||||
body: JSON.stringify({ updates: updates })
|
||||
}).then(function (r) { return r.ok; });
|
||||
})
|
||||
.catch(function () { return false; })
|
||||
.finally(function () { running = null; });
|
||||
return running;
|
||||
};
|
||||
// /cart page: merge on load and reload once if something changed.
|
||||
if (document.querySelector('.cart-page__items')) {
|
||||
window.seasonsMergeCartLines().then(function (merged) {
|
||||
if (merged && !sessionStorage.getItem('seasonsMerged')) {
|
||||
try { sessionStorage.setItem('seasonsMerged', '1'); } catch (e) {}
|
||||
window.location.reload();
|
||||
} else {
|
||||
try { sessionStorage.removeItem('seasonsMerged'); } catch (e) {}
|
||||
}
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
@@ -0,0 +1,38 @@
|
||||
{% doc %}
|
||||
Renders a category banner with its photo, title and description on the green panel.
|
||||
|
||||
@param {string} title - Category title
|
||||
@param {string} text - Category description
|
||||
@param {string} image - Optimized image asset filename
|
||||
@param {string} url - Destination collection URL
|
||||
|
||||
@example
|
||||
{% render 'category-card', title: 'Hidratantes', text: 'Descripción', image: 'banner-hidratantes.avif', url: '/collections/hidratantes' %}
|
||||
{% enddoc %}
|
||||
|
||||
<a class="collection__banner category-card" href="{{ url }}">
|
||||
<div class="collection__banner-media">
|
||||
<img
|
||||
class="collection__banner-image"
|
||||
src="{{ image | asset_url }}"
|
||||
alt="{{ title | escape }}"
|
||||
width="960"
|
||||
height="380"
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
>
|
||||
</div>
|
||||
<div class="collection__banner-copy">
|
||||
<h2 class="collection__banner-title">{{ title | escape }}</h2>
|
||||
<p class="collection__banner-text">{{ text | escape }}</p>
|
||||
<img
|
||||
class="collection__banner-blob"
|
||||
src="{{ 'Capa_1.avif' | asset_url }}"
|
||||
alt=""
|
||||
width="185"
|
||||
height="210"
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
>
|
||||
</div>
|
||||
</a>
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
@param {product} product - Product to display
|
||||
@param {string} [form_suffix] - Keeps the product form id unique
|
||||
@param {string} [badge_mode] - `tags` shows the skin label, `collection` shows the category collection, `none` hides badges
|
||||
|
||||
@example
|
||||
{% render 'collection-card', product: product, form_suffix: section.id %}
|
||||
@@ -28,25 +29,40 @@
|
||||
assign subtitle = variant.title
|
||||
endif
|
||||
|
||||
assign skin_label = product.metafields.custom.tipo_de_piel.value | default: product.metafields.custom.tipo_de_piel
|
||||
if skin_label == blank
|
||||
assign skin_label = product.metafields.custom.skin_type.value | default: product.metafields.custom.skin_type
|
||||
endif
|
||||
|
||||
assign badge_mode = badge_mode | default: 'tags'
|
||||
%}
|
||||
{% if badge_mode == 'collection' %}
|
||||
{% capture collection_label %}
|
||||
{% render 'product-collection-label', product: product %}
|
||||
{% endcapture %}
|
||||
{% endif %}
|
||||
{% liquid
|
||||
assign collection_label = collection_label | strip
|
||||
assign skin_label = blank
|
||||
assign badge_best = false
|
||||
assign badge_recommended = false
|
||||
for tag in product.tags
|
||||
assign tag_label = tag | downcase
|
||||
if tag_label contains 'vendido' or tag_label contains 'bestseller'
|
||||
assign badge_best = true
|
||||
|
||||
if badge_mode != 'none'
|
||||
if badge_mode == 'tags'
|
||||
assign skin_label = product.metafields.custom.tipo_de_piel.value | default: product.metafields.custom.tipo_de_piel
|
||||
if skin_label == blank
|
||||
assign skin_label = product.metafields.custom.skin_type.value | default: product.metafields.custom.skin_type
|
||||
endif
|
||||
endif
|
||||
if tag_label contains 'recomend'
|
||||
assign badge_recommended = true
|
||||
endif
|
||||
if skin_label == blank and tag_label contains 'piel'
|
||||
assign skin_label = tag
|
||||
endif
|
||||
endfor
|
||||
|
||||
for tag in product.tags
|
||||
assign tag_label = tag | downcase
|
||||
if tag_label contains 'vendido' or tag_label contains 'bestseller'
|
||||
assign badge_best = true
|
||||
endif
|
||||
if tag_label contains 'recomend'
|
||||
assign badge_recommended = true
|
||||
endif
|
||||
if badge_mode == 'tags' and skin_label == blank and tag_label contains 'piel'
|
||||
assign skin_label = tag
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
||||
assign rating_value = 0
|
||||
assign rating_count = 0
|
||||
@@ -99,17 +115,21 @@
|
||||
{% endif %}
|
||||
</a>
|
||||
|
||||
<div class="collection-card__badges">
|
||||
{% if badge_best %}
|
||||
<span class="collection-card__badge collection-card__badge--best">{{ 'bestsellers.badge' | t }}</span>
|
||||
{% endif %}
|
||||
{% if badge_recommended %}
|
||||
<span class="collection-card__badge collection-card__badge--best">{{ 'collection_page.recommended' | t }}</span>
|
||||
{% endif %}
|
||||
{% if skin_label != blank %}
|
||||
<span class="collection-card__badge collection-card__badge--skin">{{ skin_label | escape }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if badge_mode != 'none' %}
|
||||
<div class="collection-card__badges">
|
||||
{% if badge_best %}
|
||||
<span class="collection-card__badge collection-card__badge--best">{{ 'bestsellers.badge' | t }}</span>
|
||||
{% endif %}
|
||||
{% if badge_recommended %}
|
||||
<span class="collection-card__badge collection-card__badge--best">{{ 'collection_page.recommended' | t }}</span>
|
||||
{% endif %}
|
||||
{% if badge_mode == 'collection' and collection_label != blank %}
|
||||
<span class="collection-card__badge collection-card__badge--skin">{{ collection_label | escape }}</span>
|
||||
{% elsif badge_mode == 'tags' and skin_label != blank %}
|
||||
<span class="collection-card__badge collection-card__badge--skin">{{ skin_label | escape }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<button
|
||||
class="collection-card__wish"
|
||||
@@ -211,7 +231,7 @@
|
||||
|
||||
document.addEventListener('click', (event) => {
|
||||
const wish = event.target.closest('.collection-card [data-wishlist]');
|
||||
if (!wish) return;
|
||||
if (!wish || wish.closest('[data-product-page]')) return;
|
||||
const id = String(wish.dataset.productId || '');
|
||||
const handle = String(wish.dataset.productHandle || '');
|
||||
if (!id) return;
|
||||
@@ -225,8 +245,10 @@
|
||||
});
|
||||
|
||||
document.addEventListener('submit', async (event) => {
|
||||
if (event.defaultPrevented) return;
|
||||
const form = event.target;
|
||||
if (!(form instanceof HTMLFormElement) || !form.hasAttribute('data-collection-card')) return;
|
||||
if (form.closest('[data-product-page]')) return;
|
||||
if (event.defaultPrevented) return;
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
echo chunk
|
||||
else
|
||||
assign open_tag = chunk | split: '>' | first
|
||||
if open_tag contains 'application/json' or open_tag contains 'application/ld+json' or open_tag contains 'nolazy'
|
||||
if open_tag contains 'application/json' or open_tag contains 'application/ld+json' or open_tag contains 'nolazy' or chunk contains 'portable-wallets' or chunk contains 'shopify.dynamic_checkout'
|
||||
echo '<script'
|
||||
echo chunk
|
||||
elsif open_tag == blank
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
{%- comment -%}
|
||||
Spanish label for Shopify-generated filter names/values (the store's default language is English).
|
||||
Usage: {% render 'facet-label', text: filter.label %}
|
||||
{%- endcomment -%}
|
||||
{%- assign facet_key = text | strip | downcase -%}
|
||||
{%- case facet_key -%}
|
||||
{%- when 'availability' -%}{{ 'facets.labels.availability' | t }}
|
||||
{%- when 'in stock' -%}{{ 'facets.labels.in_stock' | t }}
|
||||
{%- when 'out of stock' -%}{{ 'facets.labels.out_of_stock' | t }}
|
||||
{%- when 'price' -%}{{ 'facets.labels.price' | t }}
|
||||
{%- when 'product type' -%}{{ 'facets.labels.product_type' | t }}
|
||||
{%- when 'brand', 'vendor' -%}{{ 'facets.labels.brand' | t }}
|
||||
{%- when 'size' -%}{{ 'facets.labels.size' | t }}
|
||||
{%- when 'color', 'colour' -%}{{ 'facets.labels.color' | t }}
|
||||
{%- when 'tags', 'tag' -%}{{ 'facets.labels.tags' | t }}
|
||||
{%- when 'category' -%}{{ 'facets.labels.category' | t }}
|
||||
{%- when 'collection', 'collections' -%}{{ 'facets.labels.collection' | t }}
|
||||
{%- else -%}{{ text | escape }}
|
||||
{%- endcase -%}
|
||||
@@ -0,0 +1,222 @@
|
||||
{%- comment -%}
|
||||
Filters + sort toolbar (shared by collection and search pages). Wrap the page in [data-collection] for the JS.
|
||||
Params: filters, sort_options, current_sort, action_url, sort_action_url, clear_url, count_label, results_type, terms, tag_list, tag_base_url
|
||||
{%- endcomment -%}
|
||||
{%- liquid
|
||||
assign sort_label = blank
|
||||
for option in sort_options
|
||||
if option.value == current_sort
|
||||
capture sort_label
|
||||
render 'sort-label', value: option.value, fallback: option.name
|
||||
endcapture
|
||||
endif
|
||||
endfor
|
||||
-%}
|
||||
<div class="collection__bar">
|
||||
<div class="collection__tools">
|
||||
<button class="collection__tool" type="button" data-filter-toggle aria-expanded="false" aria-controls="facets-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="facets-sort">
|
||||
{%- if sort_label != blank -%}{{ 'collection_page.sort' | t: sort: sort_label }}{%- else -%}{{ 'collection_page.sort_title' | t }}{%- endif -%}
|
||||
</button>
|
||||
</div>
|
||||
{%- if count_label != blank -%}<p class="collection__count">{{ count_label }}</p>{%- endif -%}
|
||||
</div>
|
||||
|
||||
<div class="collection__drawer" id="facets-filters" data-filter-panel aria-hidden="true" inert>
|
||||
<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="facets-filters-title">
|
||||
<div class="collection__drawer-head">
|
||||
<h2 id="facets-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 filters.size > 0 -%}
|
||||
<form class="collection__filter-form" action="{{ action_url }}" method="get">
|
||||
{%- if terms != blank -%}<input type="hidden" name="q" value="{{ terms | escape }}">{%- endif -%}
|
||||
{%- if results_type != blank -%}<input type="hidden" name="type" value="{{ results_type }}">{%- endif -%}
|
||||
{%- if current_sort != blank -%}<input type="hidden" name="sort_by" value="{{ current_sort }}">{%- endif -%}
|
||||
<div class="collection__filter-groups">
|
||||
{%- liquid
|
||||
assign native_tag_filter = false
|
||||
for filter in filters
|
||||
if filter.param_name contains 'tag'
|
||||
assign native_tag_filter = true
|
||||
endif
|
||||
endfor
|
||||
assign tag_options = ''
|
||||
if tag_list != blank and native_tag_filter == false
|
||||
assign hidden_tags = settings.facets_hidden_tags | downcase | split: ','
|
||||
assign seen_tags = '|'
|
||||
for tag in tag_list
|
||||
assign tag_lower = tag | downcase | strip
|
||||
assign tag_handle = tag | handleize
|
||||
assign tag_token = '|' | append: tag_handle | append: '|'
|
||||
assign skip_tag = false
|
||||
for hidden in hidden_tags
|
||||
assign hidden_clean = hidden | strip
|
||||
if hidden_clean != blank and hidden_clean == tag_lower
|
||||
assign skip_tag = true
|
||||
endif
|
||||
endfor
|
||||
if tag_lower contains '_'
|
||||
assign skip_tag = true
|
||||
endif
|
||||
if seen_tags contains tag_token
|
||||
assign skip_tag = true
|
||||
endif
|
||||
unless skip_tag
|
||||
assign seen_tags = seen_tags | append: tag_handle | append: '|'
|
||||
assign tag_options = tag_options | append: tag | append: '@@'
|
||||
endunless
|
||||
endfor
|
||||
endif
|
||||
-%}
|
||||
{%- for filter in filters -%}
|
||||
<fieldset class="collection__filter">
|
||||
<legend>{% render 'facet-label', text: filter.label %}</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" aria-label="{{ 'facets.price_from' | t }}">
|
||||
<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 }}" aria-label="{{ 'facets.price_to' | t }}">
|
||||
</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>{% render 'facet-label', text: value.label %} ({{ value.count }})</span>
|
||||
</label>
|
||||
{%- endfor -%}
|
||||
</div>
|
||||
{%- endcase -%}
|
||||
</fieldset>
|
||||
{%- endfor -%}
|
||||
{%- if tag_options != blank -%}
|
||||
{%- assign active_tags = '|' -%}
|
||||
{%- for t in current_tags -%}{%- assign t_handle = t | handleize -%}{%- assign active_tags = active_tags | append: t_handle | append: '|' -%}{%- endfor -%}
|
||||
<fieldset class="collection__filter" data-tag-filter data-base-url="{{ tag_base_url }}">
|
||||
<legend>{{ 'facets.labels.tags' | t }}</legend>
|
||||
<div class="collection__options">
|
||||
{%- assign tag_array = tag_options | split: '@@' -%}
|
||||
{%- for tag in tag_array -%}
|
||||
{%- assign tag_handle = tag | handleize -%}
|
||||
{%- assign tag_token = '|' | append: tag_handle | append: '|' -%}
|
||||
<label class="collection__option">
|
||||
<input type="checkbox" data-tag value="{{ tag_handle }}" {% if active_tags contains tag_token %}checked{% endif %}>
|
||||
<span>{{ tag | capitalize | escape }}</span>
|
||||
</label>
|
||||
{%- endfor -%}
|
||||
</div>
|
||||
</fieldset>
|
||||
{%- endif -%}
|
||||
</div>
|
||||
<div class="collection__filter-actions">
|
||||
<button class="collection__apply" type="submit">{{ 'collection_page.apply' | t }}</button>
|
||||
<a class="collection__clear" href="{{ clear_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="facets-sort" data-sort-panel aria-hidden="true" inert>
|
||||
<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="facets-sort-title">
|
||||
<div class="collection__drawer-head">
|
||||
<h2 id="facets-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="{{ sort_action_url | default: action_url }}" method="get">
|
||||
{%- if terms != blank -%}<input type="hidden" name="q" value="{{ terms | escape }}">{%- endif -%}
|
||||
{%- if results_type != blank -%}<input type="hidden" name="type" value="{{ results_type }}">{%- endif -%}
|
||||
{%- for filter in 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 | divided_by: 100.0 }}">{%- endif -%}
|
||||
{%- if filter.max_value.value -%}<input type="hidden" name="{{ filter.max_value.param_name }}" value="{{ filter.max_value.value | divided_by: 100.0 }}">{%- 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 sort_options -%}
|
||||
<button class="collection__sort-option{% if option.value == current_sort %} is-current{% endif %}" type="submit" name="sort_by" value="{{ option.value }}">{% render 'sort-label', value: option.value, fallback: option.name %}</button>
|
||||
{%- endfor -%}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script nolazy>
|
||||
(function () {
|
||||
// Shared drawer logic for collection + search. Takes over the collection section's handler.
|
||||
if (window.__seasonFacets) return;
|
||||
window.__seasonFacets = true;
|
||||
window.__seasonCollection = true;
|
||||
|
||||
var ids = { filter: 'facets-filters', sort: 'facets-sort' };
|
||||
var portal = function () {
|
||||
// Drawers live inside animated sections (transform) which breaks position:fixed; move them to <body>.
|
||||
Object.keys(ids).forEach(function (k) {
|
||||
var el = document.getElementById(ids[k]);
|
||||
if (el && el.parentElement !== document.body) document.body.appendChild(el);
|
||||
});
|
||||
};
|
||||
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', portal); else portal();
|
||||
|
||||
var setPanel = function (name, open) {
|
||||
var panel = document.getElementById(ids[name]);
|
||||
var button = document.querySelector('[data-' + name + '-toggle]');
|
||||
if (!panel) return;
|
||||
panel.classList.toggle('is-open', open);
|
||||
panel.setAttribute('aria-hidden', open ? 'false' : 'true');
|
||||
panel.inert = !open;
|
||||
if (button) button.setAttribute('aria-expanded', open ? 'true' : 'false');
|
||||
document.documentElement.classList.toggle('overflow-hidden', !!document.querySelector('.collection__drawer.is-open'));
|
||||
if (open) { var close = panel.querySelector('.collection__drawer-close'); if (close) close.focus(); }
|
||||
};
|
||||
|
||||
document.addEventListener('click', function (event) {
|
||||
var t = event.target;
|
||||
if (t.closest('[data-filter-close]')) { setPanel('filter', false); return; }
|
||||
if (t.closest('[data-sort-close]')) { setPanel('sort', false); return; }
|
||||
if (t.closest('[data-filter-toggle]')) {
|
||||
var f = document.getElementById(ids.filter);
|
||||
setPanel('sort', false); setPanel('filter', !(f && f.classList.contains('is-open'))); return;
|
||||
}
|
||||
if (t.closest('[data-sort-toggle]')) {
|
||||
var s = document.getElementById(ids.sort);
|
||||
setPanel('filter', false); setPanel('sort', !(s && s.classList.contains('is-open')));
|
||||
}
|
||||
});
|
||||
document.addEventListener('submit', function (event) {
|
||||
var form = event.target;
|
||||
if (!form.classList || !form.classList.contains('collection__filter-form')) return;
|
||||
// Keep URLs clean: drop empty price inputs.
|
||||
[].slice.call(form.querySelectorAll('input[type="number"]')).forEach(function (i) { i.disabled = i.value === ''; });
|
||||
window.setTimeout(function () { [].slice.call(form.querySelectorAll('input[type="number"]')).forEach(function (i) { i.disabled = false; }); }, 0);
|
||||
var group = form.querySelector('[data-tag-filter]');
|
||||
if (!group) return;
|
||||
var tags = [].slice.call(group.querySelectorAll('[data-tag]:checked')).map(function (i) { return i.value; });
|
||||
var base = group.getAttribute('data-base-url');
|
||||
form.setAttribute('action', tags.length ? base + '/' + tags.join('+') : base);
|
||||
}, true);
|
||||
document.addEventListener('keydown', function (event) {
|
||||
if (event.key !== 'Escape') return;
|
||||
setPanel('filter', false); setPanel('sort', false);
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
@@ -0,0 +1,34 @@
|
||||
{%- comment -%}
|
||||
Google Customer Reviews badge (seller rating). Loads on the first user interaction
|
||||
so it doesn't affect initial page performance. Configure in Theme settings › Google Customer Reviews.
|
||||
{%- endcomment -%}
|
||||
{%- if settings.gcr_badge_enabled and settings.gcr_merchant_id != blank -%}
|
||||
{%- unless request.design_mode -%}
|
||||
<script nolazy>
|
||||
(function () {
|
||||
var CFG = {
|
||||
merchant_id: {{ settings.gcr_merchant_id | strip | plus: 0 }},
|
||||
position: {{ settings.gcr_badge_position | default: 'BOTTOM_LEFT' | json }},
|
||||
region: {{ settings.gcr_region | default: 'MX' | upcase | json }}
|
||||
};
|
||||
var EVENTS = ['scroll', 'touchstart', 'pointerdown', 'mousemove', 'keydown', 'wheel'];
|
||||
var done = false;
|
||||
function inject() {
|
||||
var s = document.createElement('script');
|
||||
s.id = 'merchantWidgetScript';
|
||||
s.src = 'https://www.gstatic.com/shopping/merchant/merchantwidget.js';
|
||||
s.defer = true;
|
||||
s.setAttribute('nolazy', '');
|
||||
s.onload = function () { if (window.merchantwidget) window.merchantwidget.start(CFG); };
|
||||
document.body.appendChild(s);
|
||||
}
|
||||
function go() {
|
||||
if (done) return; done = true;
|
||||
EVENTS.forEach(function (ev) { window.removeEventListener(ev, go, { passive: true }); });
|
||||
if (document.readyState === 'complete') inject(); else window.addEventListener('load', inject, { once: true });
|
||||
}
|
||||
EVENTS.forEach(function (ev) { window.addEventListener(ev, go, { passive: true }); });
|
||||
})();
|
||||
</script>
|
||||
{%- endunless -%}
|
||||
{%- endif -%}
|
||||
@@ -297,6 +297,30 @@
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% if cards %}
|
||||
<button
|
||||
type="button"
|
||||
class="header__submenu-arrow header__submenu-arrow--prev"
|
||||
data-submenu-scroll="-1"
|
||||
hidden
|
||||
aria-label="{{ 'header.submenu_prev' | t }}"
|
||||
>
|
||||
<svg width="8" height="14" viewBox="0 0 8 14" aria-hidden="true" focusable="false">
|
||||
<path d="M1 1.2 6.8 7 1 12.8" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="header__submenu-arrow header__submenu-arrow--next"
|
||||
data-submenu-scroll="1"
|
||||
hidden
|
||||
aria-label="{{ 'header.submenu_next' | t }}"
|
||||
>
|
||||
<svg width="8" height="14" viewBox="0 0 8 14" aria-hidden="true" focusable="false">
|
||||
<path d="M1 1.2 6.8 7 1 12.8" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
</button>
|
||||
{% endif %}
|
||||
{% elsif show_caret %}
|
||||
<span class="header__icon header__icon--caret" aria-hidden="true">
|
||||
{{ 'icon-caret-down.svg' | inline_asset_content }}
|
||||
|
||||