TOP SALE
NIÑA
NIÑO
NEUTRAL
{
$event.stopPropagation();
jeanSizes = [];
selectedSize = null;
for(variant in productVariants){
if(productVariants[variant].options[$event.detail.option_index] == $event.detail.option_value){
selectedVariant = productVariants[variant]
break
}
}
for(option in productOptions){
if(productOptions[option].name.toLowerCase() != 'color'){
selectedColorOptions = productOptions[option].values
break
}
}
for(variant in productVariants){
if(productVariants[variant].option1 == selectedVariant.option1){
let size = productVariants[variant].option2.split('-')[0];
let length = productVariants[variant].option2.split('-')[1];
// console.log(productVariants[variant])
jeanSizes.push({size: size, length: length, variant: productVariants[variant]})
}
}
// New image logic (same as pdp but choosing the first image that matches the current variant's color code)
let jsonVariants = JSON.parse(document.querySelector('#card-product-variants-10170589839633').innerText);
let jsonImages = JSON.parse(document.querySelector('#card-product-images-10170589839633').innerText);
let jsonSelectedVariant = jsonVariants.find(variant => variant.id == selectedVariant.id);
let selectedVariantColorCode = jsonSelectedVariant.color_code;
let selectedVariantImage = jsonImages.find(image => image.color_code == selectedVariantColorCode);
if(selectedVariantImage){
document.querySelector('.variant-img-container-10170589839633-template--23382620668177__multi_collection_slider_jEja39 img').src = selectedVariantImage.src;
document.querySelector('.variant-img-container-10170589839633-template--23382620668177__multi_collection_slider_jEja39 img').srcset = selectedVariantImage.src;
document.querySelector('.variant-img-container-10170589839633-template--23382620668177__multi_collection_slider_jEja39 .secondary-image-hover').classList.add('hidden');
} else {
if(selectedVariant.featured_image){
document.querySelector('.variant-img-container-10170589839633-template--23382620668177__multi_collection_slider_jEja39 img').src = selectedVariant.featured_image.src;
document.querySelector('.variant-img-container-10170589839633-template--23382620668177__multi_collection_slider_jEja39 img').srcset = selectedVariant.featured_image.src;
document.querySelector('.variant-img-container-10170589839633-template--23382620668177__multi_collection_slider_jEja39 .secondary-image-hover').classList.add('hidden');
}
}
})
"
@option-updated="
$nextTick(() => {
$event.stopPropagation();
for(variant in productVariants){
if(productVariants[variant].options[$event.detail.index - 1] == $event.detail.option && productVariants[variant].options[$event.detail.colorIndex - 1] == selectedVariant.options[$event.detail.colorIndex - 1]){
if(productVariants[variant].available) {
selectedVariant = productVariants[variant];
if(hasJeansLogic){
document.querySelectorAll('.jeans-length-swatch-t-shirt-45').forEach((swatch) => {
swatch.classList.remove('border-black')
});
$event.target.classList.add('border-black');
} else {
document.querySelectorAll('.size-swatch-t-shirt-45').forEach((swatch) => {
swatch.classList.remove('border-black')
});
$event.target.classList.add('border-black');
};
}
break
}
}
})
"
>
UYU 299
UYU 269
Art: 13226024
CAMISETA BEATE
Art: 13226024
GUÍA DE TALLES
BABYKIDSMINI
Guia de talles
Guia de talles
Guia de talles
{
$event.stopPropagation();
jeanSizes = [];
selectedSize = null;
for(variant in productVariants){
if(productVariants[variant].options[$event.detail.option_index] == $event.detail.option_value){
selectedVariant = productVariants[variant]
break
}
}
for(option in productOptions){
if(productOptions[option].name.toLowerCase() != 'color'){
selectedColorOptions = productOptions[option].values
break
}
}
for(variant in productVariants){
if(productVariants[variant].option1 == selectedVariant.option1){
let size = productVariants[variant].option2.split('-')[0];
let length = productVariants[variant].option2.split('-')[1];
// console.log(productVariants[variant])
jeanSizes.push({size: size, length: length, variant: productVariants[variant]})
}
}
// New image logic (same as pdp but choosing the first image that matches the current variant's color code)
let jsonVariants = JSON.parse(document.querySelector('#card-product-variants-10130978898193').innerText);
let jsonImages = JSON.parse(document.querySelector('#card-product-images-10130978898193').innerText);
let jsonSelectedVariant = jsonVariants.find(variant => variant.id == selectedVariant.id);
let selectedVariantColorCode = jsonSelectedVariant.color_code;
let selectedVariantImage = jsonImages.find(image => image.color_code == selectedVariantColorCode);
if(selectedVariantImage){
document.querySelector('.variant-img-container-10130978898193-template--23382620668177__multi_collection_slider_jEja39 img').src = selectedVariantImage.src;
document.querySelector('.variant-img-container-10130978898193-template--23382620668177__multi_collection_slider_jEja39 img').srcset = selectedVariantImage.src;
document.querySelector('.variant-img-container-10130978898193-template--23382620668177__multi_collection_slider_jEja39 .secondary-image-hover').classList.add('hidden');
} else {
if(selectedVariant.featured_image){
document.querySelector('.variant-img-container-10130978898193-template--23382620668177__multi_collection_slider_jEja39 img').src = selectedVariant.featured_image.src;
document.querySelector('.variant-img-container-10130978898193-template--23382620668177__multi_collection_slider_jEja39 img').srcset = selectedVariant.featured_image.src;
document.querySelector('.variant-img-container-10130978898193-template--23382620668177__multi_collection_slider_jEja39 .secondary-image-hover').classList.add('hidden');
}
}
})
"
@option-updated="
$nextTick(() => {
$event.stopPropagation();
for(variant in productVariants){
if(productVariants[variant].options[$event.detail.index - 1] == $event.detail.option && productVariants[variant].options[$event.detail.colorIndex - 1] == selectedVariant.options[$event.detail.colorIndex - 1]){
if(productVariants[variant].available) {
selectedVariant = productVariants[variant];
if(hasJeansLogic){
document.querySelectorAll('.jeans-length-swatch-shorts-40').forEach((swatch) => {
swatch.classList.remove('border-black')
});
$event.target.classList.add('border-black');
} else {
document.querySelectorAll('.size-swatch-shorts-40').forEach((swatch) => {
swatch.classList.remove('border-black')
});
$event.target.classList.add('border-black');
};
}
break
}
}
})
"
>
UYU 499
UYU 449
Art: 13201050
SHORT VERMO
Art: 13201050
GUÍA DE TALLES
BABYKIDSMINI
Guia de talles
Guia de talles
Guia de talles
{
$event.stopPropagation();
jeanSizes = [];
selectedSize = null;
for(variant in productVariants){
if(productVariants[variant].options[$event.detail.option_index] == $event.detail.option_value){
selectedVariant = productVariants[variant]
break
}
}
for(option in productOptions){
if(productOptions[option].name.toLowerCase() != 'color'){
selectedColorOptions = productOptions[option].values
break
}
}
for(variant in productVariants){
if(productVariants[variant].option1 == selectedVariant.option1){
let size = productVariants[variant].option2.split('-')[0];
let length = productVariants[variant].option2.split('-')[1];
// console.log(productVariants[variant])
jeanSizes.push({size: size, length: length, variant: productVariants[variant]})
}
}
// New image logic (same as pdp but choosing the first image that matches the current variant's color code)
let jsonVariants = JSON.parse(document.querySelector('#card-product-variants-10142414078225').innerText);
let jsonImages = JSON.parse(document.querySelector('#card-product-images-10142414078225').innerText);
let jsonSelectedVariant = jsonVariants.find(variant => variant.id == selectedVariant.id);
let selectedVariantColorCode = jsonSelectedVariant.color_code;
let selectedVariantImage = jsonImages.find(image => image.color_code == selectedVariantColorCode);
if(selectedVariantImage){
document.querySelector('.variant-img-container-10142414078225-template--23382620668177__multi_collection_slider_jEja39 img').src = selectedVariantImage.src;
document.querySelector('.variant-img-container-10142414078225-template--23382620668177__multi_collection_slider_jEja39 img').srcset = selectedVariantImage.src;
document.querySelector('.variant-img-container-10142414078225-template--23382620668177__multi_collection_slider_jEja39 .secondary-image-hover').classList.add('hidden');
} else {
if(selectedVariant.featured_image){
document.querySelector('.variant-img-container-10142414078225-template--23382620668177__multi_collection_slider_jEja39 img').src = selectedVariant.featured_image.src;
document.querySelector('.variant-img-container-10142414078225-template--23382620668177__multi_collection_slider_jEja39 img').srcset = selectedVariant.featured_image.src;
document.querySelector('.variant-img-container-10142414078225-template--23382620668177__multi_collection_slider_jEja39 .secondary-image-hover').classList.add('hidden');
}
}
})
"
@option-updated="
$nextTick(() => {
$event.stopPropagation();
for(variant in productVariants){
if(productVariants[variant].options[$event.detail.index - 1] == $event.detail.option && productVariants[variant].options[$event.detail.colorIndex - 1] == selectedVariant.options[$event.detail.colorIndex - 1]){
if(productVariants[variant].available) {
selectedVariant = productVariants[variant];
if(hasJeansLogic){
document.querySelectorAll('.jeans-length-swatch-shorts-51').forEach((swatch) => {
swatch.classList.remove('border-black')
});
$event.target.classList.add('border-black');
} else {
document.querySelectorAll('.size-swatch-shorts-51').forEach((swatch) => {
swatch.classList.remove('border-black')
});
$event.target.classList.add('border-black');
};
}
break
}
}
})
"
>
UYU 349
UYU 314
Art: 13230214
SHORT VALINKA
Art: 13230214
GUÍA DE TALLES
BABYKIDSMINI
Guia de talles
Guia de talles
Guia de talles
{
$event.stopPropagation();
jeanSizes = [];
selectedSize = null;
for(variant in productVariants){
if(productVariants[variant].options[$event.detail.option_index] == $event.detail.option_value){
selectedVariant = productVariants[variant]
break
}
}
for(option in productOptions){
if(productOptions[option].name.toLowerCase() != 'color'){
selectedColorOptions = productOptions[option].values
break
}
}
for(variant in productVariants){
if(productVariants[variant].option1 == selectedVariant.option1){
let size = productVariants[variant].option2.split('-')[0];
let length = productVariants[variant].option2.split('-')[1];
// console.log(productVariants[variant])
jeanSizes.push({size: size, length: length, variant: productVariants[variant]})
}
}
// New image logic (same as pdp but choosing the first image that matches the current variant's color code)
let jsonVariants = JSON.parse(document.querySelector('#card-product-variants-10170669170961').innerText);
let jsonImages = JSON.parse(document.querySelector('#card-product-images-10170669170961').innerText);
let jsonSelectedVariant = jsonVariants.find(variant => variant.id == selectedVariant.id);
let selectedVariantColorCode = jsonSelectedVariant.color_code;
let selectedVariantImage = jsonImages.find(image => image.color_code == selectedVariantColorCode);
if(selectedVariantImage){
document.querySelector('.variant-img-container-10170669170961-template--23382620668177__multi_collection_slider_jEja39 img').src = selectedVariantImage.src;
document.querySelector('.variant-img-container-10170669170961-template--23382620668177__multi_collection_slider_jEja39 img').srcset = selectedVariantImage.src;
document.querySelector('.variant-img-container-10170669170961-template--23382620668177__multi_collection_slider_jEja39 .secondary-image-hover').classList.add('hidden');
} else {
if(selectedVariant.featured_image){
document.querySelector('.variant-img-container-10170669170961-template--23382620668177__multi_collection_slider_jEja39 img').src = selectedVariant.featured_image.src;
document.querySelector('.variant-img-container-10170669170961-template--23382620668177__multi_collection_slider_jEja39 img').srcset = selectedVariant.featured_image.src;
document.querySelector('.variant-img-container-10170669170961-template--23382620668177__multi_collection_slider_jEja39 .secondary-image-hover').classList.add('hidden');
}
}
})
"
@option-updated="
$nextTick(() => {
$event.stopPropagation();
for(variant in productVariants){
if(productVariants[variant].options[$event.detail.index - 1] == $event.detail.option && productVariants[variant].options[$event.detail.colorIndex - 1] == selectedVariant.options[$event.detail.colorIndex - 1]){
if(productVariants[variant].available) {
selectedVariant = productVariants[variant];
if(hasJeansLogic){
document.querySelectorAll('.jeans-length-swatch-short-dress-11').forEach((swatch) => {
swatch.classList.remove('border-black')
});
$event.target.classList.add('border-black');
} else {
document.querySelectorAll('.size-swatch-short-dress-11').forEach((swatch) => {
swatch.classList.remove('border-black')
});
$event.target.classList.add('border-black');
};
}
break
}
}
})
"
>
UYU 449
UYU 404
Art: 13231015
VESTIDO VIDA
Art: 13231015
GUÍA DE TALLES
BABYKIDSMINI
Guia de talles
Guia de talles
Guia de talles
{
$event.stopPropagation();
jeanSizes = [];
selectedSize = null;
for(variant in productVariants){
if(productVariants[variant].options[$event.detail.option_index] == $event.detail.option_value){
selectedVariant = productVariants[variant]
break
}
}
for(option in productOptions){
if(productOptions[option].name.toLowerCase() != 'color'){
selectedColorOptions = productOptions[option].values
break
}
}
for(variant in productVariants){
if(productVariants[variant].option1 == selectedVariant.option1){
let size = productVariants[variant].option2.split('-')[0];
let length = productVariants[variant].option2.split('-')[1];
// console.log(productVariants[variant])
jeanSizes.push({size: size, length: length, variant: productVariants[variant]})
}
}
// New image logic (same as pdp but choosing the first image that matches the current variant's color code)
let jsonVariants = JSON.parse(document.querySelector('#card-product-variants-10132940128529').innerText);
let jsonImages = JSON.parse(document.querySelector('#card-product-images-10132940128529').innerText);
let jsonSelectedVariant = jsonVariants.find(variant => variant.id == selectedVariant.id);
let selectedVariantColorCode = jsonSelectedVariant.color_code;
let selectedVariantImage = jsonImages.find(image => image.color_code == selectedVariantColorCode);
if(selectedVariantImage){
document.querySelector('.variant-img-container-10132940128529-template--23382620668177__multi_collection_slider_jEja39 img').src = selectedVariantImage.src;
document.querySelector('.variant-img-container-10132940128529-template--23382620668177__multi_collection_slider_jEja39 img').srcset = selectedVariantImage.src;
document.querySelector('.variant-img-container-10132940128529-template--23382620668177__multi_collection_slider_jEja39 .secondary-image-hover').classList.add('hidden');
} else {
if(selectedVariant.featured_image){
document.querySelector('.variant-img-container-10132940128529-template--23382620668177__multi_collection_slider_jEja39 img').src = selectedVariant.featured_image.src;
document.querySelector('.variant-img-container-10132940128529-template--23382620668177__multi_collection_slider_jEja39 img').srcset = selectedVariant.featured_image.src;
document.querySelector('.variant-img-container-10132940128529-template--23382620668177__multi_collection_slider_jEja39 .secondary-image-hover').classList.add('hidden');
}
}
})
"
@option-updated="
$nextTick(() => {
$event.stopPropagation();
for(variant in productVariants){
if(productVariants[variant].options[$event.detail.index - 1] == $event.detail.option && productVariants[variant].options[$event.detail.colorIndex - 1] == selectedVariant.options[$event.detail.colorIndex - 1]){
if(productVariants[variant].available) {
selectedVariant = productVariants[variant];
if(hasJeansLogic){
document.querySelectorAll('.jeans-length-swatch-leggings-11').forEach((swatch) => {
swatch.classList.remove('border-black')
});
$event.target.classList.add('border-black');
} else {
document.querySelectorAll('.size-swatch-leggings-11').forEach((swatch) => {
swatch.classList.remove('border-black')
});
$event.target.classList.add('border-black');
};
}
break
}
}
})
"
>
UYU 299
UYU 269
Art: 13228153
BIKER VIVIAN
Art: 13228153
GUÍA DE TALLES
BABYKIDSMINI
Guia de talles
Guia de talles
Guia de talles
{
$event.stopPropagation();
jeanSizes = [];
selectedSize = null;
for(variant in productVariants){
if(productVariants[variant].options[$event.detail.option_index] == $event.detail.option_value){
selectedVariant = productVariants[variant]
break
}
}
for(option in productOptions){
if(productOptions[option].name.toLowerCase() != 'color'){
selectedColorOptions = productOptions[option].values
break
}
}
for(variant in productVariants){
if(productVariants[variant].option1 == selectedVariant.option1){
let size = productVariants[variant].option2.split('-')[0];
let length = productVariants[variant].option2.split('-')[1];
// console.log(productVariants[variant])
jeanSizes.push({size: size, length: length, variant: productVariants[variant]})
}
}
// New image logic (same as pdp but choosing the first image that matches the current variant's color code)
let jsonVariants = JSON.parse(document.querySelector('#card-product-variants-10071956521233').innerText);
let jsonImages = JSON.parse(document.querySelector('#card-product-images-10071956521233').innerText);
let jsonSelectedVariant = jsonVariants.find(variant => variant.id == selectedVariant.id);
let selectedVariantColorCode = jsonSelectedVariant.color_code;
let selectedVariantImage = jsonImages.find(image => image.color_code == selectedVariantColorCode);
if(selectedVariantImage){
document.querySelector('.variant-img-container-10071956521233-template--23382620668177__multi_collection_slider_jEja39 img').src = selectedVariantImage.src;
document.querySelector('.variant-img-container-10071956521233-template--23382620668177__multi_collection_slider_jEja39 img').srcset = selectedVariantImage.src;
document.querySelector('.variant-img-container-10071956521233-template--23382620668177__multi_collection_slider_jEja39 .secondary-image-hover').classList.add('hidden');
} else {
if(selectedVariant.featured_image){
document.querySelector('.variant-img-container-10071956521233-template--23382620668177__multi_collection_slider_jEja39 img').src = selectedVariant.featured_image.src;
document.querySelector('.variant-img-container-10071956521233-template--23382620668177__multi_collection_slider_jEja39 img').srcset = selectedVariant.featured_image.src;
document.querySelector('.variant-img-container-10071956521233-template--23382620668177__multi_collection_slider_jEja39 .secondary-image-hover').classList.add('hidden');
}
}
})
"
@option-updated="
$nextTick(() => {
$event.stopPropagation();
for(variant in productVariants){
if(productVariants[variant].options[$event.detail.index - 1] == $event.detail.option && productVariants[variant].options[$event.detail.colorIndex - 1] == selectedVariant.options[$event.detail.colorIndex - 1]){
if(productVariants[variant].available) {
selectedVariant = productVariants[variant];
if(hasJeansLogic){
document.querySelectorAll('.jeans-length-swatch-t-shirt-6').forEach((swatch) => {
swatch.classList.remove('border-black')
});
$event.target.classList.add('border-black');
} else {
document.querySelectorAll('.size-swatch-t-shirt-6').forEach((swatch) => {
swatch.classList.remove('border-black')
});
$event.target.classList.add('border-black');
};
}
break
}
}
})
"
>
UYU 349UYU 99
Art: 13216962
CAMISETA VECTOR
Art: 13216962
GUÍA DE TALLES
BABYKIDSMINI
Guia de talles
Guia de talles
Guia de talles
{
$event.stopPropagation();
jeanSizes = [];
selectedSize = null;
for(variant in productVariants){
if(productVariants[variant].options[$event.detail.option_index] == $event.detail.option_value){
selectedVariant = productVariants[variant]
break
}
}
for(option in productOptions){
if(productOptions[option].name.toLowerCase() != 'color'){
selectedColorOptions = productOptions[option].values
break
}
}
for(variant in productVariants){
if(productVariants[variant].option1 == selectedVariant.option1){
let size = productVariants[variant].option2.split('-')[0];
let length = productVariants[variant].option2.split('-')[1];
// console.log(productVariants[variant])
jeanSizes.push({size: size, length: length, variant: productVariants[variant]})
}
}
// New image logic (same as pdp but choosing the first image that matches the current variant's color code)
let jsonVariants = JSON.parse(document.querySelector('#card-product-variants-10170589839633').innerText);
let jsonImages = JSON.parse(document.querySelector('#card-product-images-10170589839633').innerText);
let jsonSelectedVariant = jsonVariants.find(variant => variant.id == selectedVariant.id);
let selectedVariantColorCode = jsonSelectedVariant.color_code;
let selectedVariantImage = jsonImages.find(image => image.color_code == selectedVariantColorCode);
if(selectedVariantImage){
document.querySelector('.variant-img-container-10170589839633-template--23382620668177__multi_collection_slider_jEja39 img').src = selectedVariantImage.src;
document.querySelector('.variant-img-container-10170589839633-template--23382620668177__multi_collection_slider_jEja39 img').srcset = selectedVariantImage.src;
document.querySelector('.variant-img-container-10170589839633-template--23382620668177__multi_collection_slider_jEja39 .secondary-image-hover').classList.add('hidden');
} else {
if(selectedVariant.featured_image){
document.querySelector('.variant-img-container-10170589839633-template--23382620668177__multi_collection_slider_jEja39 img').src = selectedVariant.featured_image.src;
document.querySelector('.variant-img-container-10170589839633-template--23382620668177__multi_collection_slider_jEja39 img').srcset = selectedVariant.featured_image.src;
document.querySelector('.variant-img-container-10170589839633-template--23382620668177__multi_collection_slider_jEja39 .secondary-image-hover').classList.add('hidden');
}
}
})
"
@option-updated="
$nextTick(() => {
$event.stopPropagation();
for(variant in productVariants){
if(productVariants[variant].options[$event.detail.index - 1] == $event.detail.option && productVariants[variant].options[$event.detail.colorIndex - 1] == selectedVariant.options[$event.detail.colorIndex - 1]){
if(productVariants[variant].available) {
selectedVariant = productVariants[variant];
if(hasJeansLogic){
document.querySelectorAll('.jeans-length-swatch-t-shirt-45').forEach((swatch) => {
swatch.classList.remove('border-black')
});
$event.target.classList.add('border-black');
} else {
document.querySelectorAll('.size-swatch-t-shirt-45').forEach((swatch) => {
swatch.classList.remove('border-black')
});
$event.target.classList.add('border-black');
};
}
break
}
}
})
"
>
UYU 299
UYU 269
Art: 13226024
CAMISETA BEATE
Art: 13226024
GUÍA DE TALLES
BABYKIDSMINI
Guia de talles
Guia de talles
Guia de talles
{
$event.stopPropagation();
jeanSizes = [];
selectedSize = null;
for(variant in productVariants){
if(productVariants[variant].options[$event.detail.option_index] == $event.detail.option_value){
selectedVariant = productVariants[variant]
break
}
}
for(option in productOptions){
if(productOptions[option].name.toLowerCase() != 'color'){
selectedColorOptions = productOptions[option].values
break
}
}
for(variant in productVariants){
if(productVariants[variant].option1 == selectedVariant.option1){
let size = productVariants[variant].option2.split('-')[0];
let length = productVariants[variant].option2.split('-')[1];
// console.log(productVariants[variant])
jeanSizes.push({size: size, length: length, variant: productVariants[variant]})
}
}
// New image logic (same as pdp but choosing the first image that matches the current variant's color code)
let jsonVariants = JSON.parse(document.querySelector('#card-product-variants-10130978898193').innerText);
let jsonImages = JSON.parse(document.querySelector('#card-product-images-10130978898193').innerText);
let jsonSelectedVariant = jsonVariants.find(variant => variant.id == selectedVariant.id);
let selectedVariantColorCode = jsonSelectedVariant.color_code;
let selectedVariantImage = jsonImages.find(image => image.color_code == selectedVariantColorCode);
if(selectedVariantImage){
document.querySelector('.variant-img-container-10130978898193-template--23382620668177__multi_collection_slider_jEja39 img').src = selectedVariantImage.src;
document.querySelector('.variant-img-container-10130978898193-template--23382620668177__multi_collection_slider_jEja39 img').srcset = selectedVariantImage.src;
document.querySelector('.variant-img-container-10130978898193-template--23382620668177__multi_collection_slider_jEja39 .secondary-image-hover').classList.add('hidden');
} else {
if(selectedVariant.featured_image){
document.querySelector('.variant-img-container-10130978898193-template--23382620668177__multi_collection_slider_jEja39 img').src = selectedVariant.featured_image.src;
document.querySelector('.variant-img-container-10130978898193-template--23382620668177__multi_collection_slider_jEja39 img').srcset = selectedVariant.featured_image.src;
document.querySelector('.variant-img-container-10130978898193-template--23382620668177__multi_collection_slider_jEja39 .secondary-image-hover').classList.add('hidden');
}
}
})
"
@option-updated="
$nextTick(() => {
$event.stopPropagation();
for(variant in productVariants){
if(productVariants[variant].options[$event.detail.index - 1] == $event.detail.option && productVariants[variant].options[$event.detail.colorIndex - 1] == selectedVariant.options[$event.detail.colorIndex - 1]){
if(productVariants[variant].available) {
selectedVariant = productVariants[variant];
if(hasJeansLogic){
document.querySelectorAll('.jeans-length-swatch-shorts-40').forEach((swatch) => {
swatch.classList.remove('border-black')
});
$event.target.classList.add('border-black');
} else {
document.querySelectorAll('.size-swatch-shorts-40').forEach((swatch) => {
swatch.classList.remove('border-black')
});
$event.target.classList.add('border-black');
};
}
break
}
}
})
"
>
UYU 499
UYU 449
Art: 13201050
SHORT VERMO
Art: 13201050
GUÍA DE TALLES
BABYKIDSMINI
Guia de talles
Guia de talles
Guia de talles
{
$event.stopPropagation();
jeanSizes = [];
selectedSize = null;
for(variant in productVariants){
if(productVariants[variant].options[$event.detail.option_index] == $event.detail.option_value){
selectedVariant = productVariants[variant]
break
}
}
for(option in productOptions){
if(productOptions[option].name.toLowerCase() != 'color'){
selectedColorOptions = productOptions[option].values
break
}
}
for(variant in productVariants){
if(productVariants[variant].option1 == selectedVariant.option1){
let size = productVariants[variant].option2.split('-')[0];
let length = productVariants[variant].option2.split('-')[1];
// console.log(productVariants[variant])
jeanSizes.push({size: size, length: length, variant: productVariants[variant]})
}
}
// New image logic (same as pdp but choosing the first image that matches the current variant's color code)
let jsonVariants = JSON.parse(document.querySelector('#card-product-variants-10142414078225').innerText);
let jsonImages = JSON.parse(document.querySelector('#card-product-images-10142414078225').innerText);
let jsonSelectedVariant = jsonVariants.find(variant => variant.id == selectedVariant.id);
let selectedVariantColorCode = jsonSelectedVariant.color_code;
let selectedVariantImage = jsonImages.find(image => image.color_code == selectedVariantColorCode);
if(selectedVariantImage){
document.querySelector('.variant-img-container-10142414078225-template--23382620668177__multi_collection_slider_jEja39 img').src = selectedVariantImage.src;
document.querySelector('.variant-img-container-10142414078225-template--23382620668177__multi_collection_slider_jEja39 img').srcset = selectedVariantImage.src;
document.querySelector('.variant-img-container-10142414078225-template--23382620668177__multi_collection_slider_jEja39 .secondary-image-hover').classList.add('hidden');
} else {
if(selectedVariant.featured_image){
document.querySelector('.variant-img-container-10142414078225-template--23382620668177__multi_collection_slider_jEja39 img').src = selectedVariant.featured_image.src;
document.querySelector('.variant-img-container-10142414078225-template--23382620668177__multi_collection_slider_jEja39 img').srcset = selectedVariant.featured_image.src;
document.querySelector('.variant-img-container-10142414078225-template--23382620668177__multi_collection_slider_jEja39 .secondary-image-hover').classList.add('hidden');
}
}
})
"
@option-updated="
$nextTick(() => {
$event.stopPropagation();
for(variant in productVariants){
if(productVariants[variant].options[$event.detail.index - 1] == $event.detail.option && productVariants[variant].options[$event.detail.colorIndex - 1] == selectedVariant.options[$event.detail.colorIndex - 1]){
if(productVariants[variant].available) {
selectedVariant = productVariants[variant];
if(hasJeansLogic){
document.querySelectorAll('.jeans-length-swatch-shorts-51').forEach((swatch) => {
swatch.classList.remove('border-black')
});
$event.target.classList.add('border-black');
} else {
document.querySelectorAll('.size-swatch-shorts-51').forEach((swatch) => {
swatch.classList.remove('border-black')
});
$event.target.classList.add('border-black');
};
}
break
}
}
})
"
>
UYU 349
UYU 314
Art: 13230214
SHORT VALINKA
Art: 13230214
GUÍA DE TALLES
BABYKIDSMINI
Guia de talles
Guia de talles
Guia de talles
{
$event.stopPropagation();
jeanSizes = [];
selectedSize = null;
for(variant in productVariants){
if(productVariants[variant].options[$event.detail.option_index] == $event.detail.option_value){
selectedVariant = productVariants[variant]
break
}
}
for(option in productOptions){
if(productOptions[option].name.toLowerCase() != 'color'){
selectedColorOptions = productOptions[option].values
break
}
}
for(variant in productVariants){
if(productVariants[variant].option1 == selectedVariant.option1){
let size = productVariants[variant].option2.split('-')[0];
let length = productVariants[variant].option2.split('-')[1];
// console.log(productVariants[variant])
jeanSizes.push({size: size, length: length, variant: productVariants[variant]})
}
}
// New image logic (same as pdp but choosing the first image that matches the current variant's color code)
let jsonVariants = JSON.parse(document.querySelector('#card-product-variants-10170669170961').innerText);
let jsonImages = JSON.parse(document.querySelector('#card-product-images-10170669170961').innerText);
let jsonSelectedVariant = jsonVariants.find(variant => variant.id == selectedVariant.id);
let selectedVariantColorCode = jsonSelectedVariant.color_code;
let selectedVariantImage = jsonImages.find(image => image.color_code == selectedVariantColorCode);
if(selectedVariantImage){
document.querySelector('.variant-img-container-10170669170961-template--23382620668177__multi_collection_slider_jEja39 img').src = selectedVariantImage.src;
document.querySelector('.variant-img-container-10170669170961-template--23382620668177__multi_collection_slider_jEja39 img').srcset = selectedVariantImage.src;
document.querySelector('.variant-img-container-10170669170961-template--23382620668177__multi_collection_slider_jEja39 .secondary-image-hover').classList.add('hidden');
} else {
if(selectedVariant.featured_image){
document.querySelector('.variant-img-container-10170669170961-template--23382620668177__multi_collection_slider_jEja39 img').src = selectedVariant.featured_image.src;
document.querySelector('.variant-img-container-10170669170961-template--23382620668177__multi_collection_slider_jEja39 img').srcset = selectedVariant.featured_image.src;
document.querySelector('.variant-img-container-10170669170961-template--23382620668177__multi_collection_slider_jEja39 .secondary-image-hover').classList.add('hidden');
}
}
})
"
@option-updated="
$nextTick(() => {
$event.stopPropagation();
for(variant in productVariants){
if(productVariants[variant].options[$event.detail.index - 1] == $event.detail.option && productVariants[variant].options[$event.detail.colorIndex - 1] == selectedVariant.options[$event.detail.colorIndex - 1]){
if(productVariants[variant].available) {
selectedVariant = productVariants[variant];
if(hasJeansLogic){
document.querySelectorAll('.jeans-length-swatch-short-dress-11').forEach((swatch) => {
swatch.classList.remove('border-black')
});
$event.target.classList.add('border-black');
} else {
document.querySelectorAll('.size-swatch-short-dress-11').forEach((swatch) => {
swatch.classList.remove('border-black')
});
$event.target.classList.add('border-black');
};
}
break
}
}
})
"
>
UYU 449
UYU 404
Art: 13231015
VESTIDO VIDA
Art: 13231015
GUÍA DE TALLES
BABYKIDSMINI
Guia de talles
Guia de talles
Guia de talles
{
$event.stopPropagation();
jeanSizes = [];
selectedSize = null;
for(variant in productVariants){
if(productVariants[variant].options[$event.detail.option_index] == $event.detail.option_value){
selectedVariant = productVariants[variant]
break
}
}
for(option in productOptions){
if(productOptions[option].name.toLowerCase() != 'color'){
selectedColorOptions = productOptions[option].values
break
}
}
for(variant in productVariants){
if(productVariants[variant].option1 == selectedVariant.option1){
let size = productVariants[variant].option2.split('-')[0];
let length = productVariants[variant].option2.split('-')[1];
// console.log(productVariants[variant])
jeanSizes.push({size: size, length: length, variant: productVariants[variant]})
}
}
// New image logic (same as pdp but choosing the first image that matches the current variant's color code)
let jsonVariants = JSON.parse(document.querySelector('#card-product-variants-10132940128529').innerText);
let jsonImages = JSON.parse(document.querySelector('#card-product-images-10132940128529').innerText);
let jsonSelectedVariant = jsonVariants.find(variant => variant.id == selectedVariant.id);
let selectedVariantColorCode = jsonSelectedVariant.color_code;
let selectedVariantImage = jsonImages.find(image => image.color_code == selectedVariantColorCode);
if(selectedVariantImage){
document.querySelector('.variant-img-container-10132940128529-template--23382620668177__multi_collection_slider_jEja39 img').src = selectedVariantImage.src;
document.querySelector('.variant-img-container-10132940128529-template--23382620668177__multi_collection_slider_jEja39 img').srcset = selectedVariantImage.src;
document.querySelector('.variant-img-container-10132940128529-template--23382620668177__multi_collection_slider_jEja39 .secondary-image-hover').classList.add('hidden');
} else {
if(selectedVariant.featured_image){
document.querySelector('.variant-img-container-10132940128529-template--23382620668177__multi_collection_slider_jEja39 img').src = selectedVariant.featured_image.src;
document.querySelector('.variant-img-container-10132940128529-template--23382620668177__multi_collection_slider_jEja39 img').srcset = selectedVariant.featured_image.src;
document.querySelector('.variant-img-container-10132940128529-template--23382620668177__multi_collection_slider_jEja39 .secondary-image-hover').classList.add('hidden');
}
}
})
"
@option-updated="
$nextTick(() => {
$event.stopPropagation();
for(variant in productVariants){
if(productVariants[variant].options[$event.detail.index - 1] == $event.detail.option && productVariants[variant].options[$event.detail.colorIndex - 1] == selectedVariant.options[$event.detail.colorIndex - 1]){
if(productVariants[variant].available) {
selectedVariant = productVariants[variant];
if(hasJeansLogic){
document.querySelectorAll('.jeans-length-swatch-leggings-11').forEach((swatch) => {
swatch.classList.remove('border-black')
});
$event.target.classList.add('border-black');
} else {
document.querySelectorAll('.size-swatch-leggings-11').forEach((swatch) => {
swatch.classList.remove('border-black')
});
$event.target.classList.add('border-black');
};
}
break
}
}
})
"
>
UYU 299
UYU 269
Art: 13228153
BIKER VIVIAN
Art: 13228153
GUÍA DE TALLES
BABYKIDSMINI
Guia de talles
Guia de talles
Guia de talles
{
$event.stopPropagation();
jeanSizes = [];
selectedSize = null;
for(variant in productVariants){
if(productVariants[variant].options[$event.detail.option_index] == $event.detail.option_value){
selectedVariant = productVariants[variant]
break
}
}
for(option in productOptions){
if(productOptions[option].name.toLowerCase() != 'color'){
selectedColorOptions = productOptions[option].values
break
}
}
for(variant in productVariants){
if(productVariants[variant].option1 == selectedVariant.option1){
let size = productVariants[variant].option2.split('-')[0];
let length = productVariants[variant].option2.split('-')[1];
// console.log(productVariants[variant])
jeanSizes.push({size: size, length: length, variant: productVariants[variant]})
}
}
// New image logic (same as pdp but choosing the first image that matches the current variant's color code)
let jsonVariants = JSON.parse(document.querySelector('#card-product-variants-10071956521233').innerText);
let jsonImages = JSON.parse(document.querySelector('#card-product-images-10071956521233').innerText);
let jsonSelectedVariant = jsonVariants.find(variant => variant.id == selectedVariant.id);
let selectedVariantColorCode = jsonSelectedVariant.color_code;
let selectedVariantImage = jsonImages.find(image => image.color_code == selectedVariantColorCode);
if(selectedVariantImage){
document.querySelector('.variant-img-container-10071956521233-template--23382620668177__multi_collection_slider_jEja39 img').src = selectedVariantImage.src;
document.querySelector('.variant-img-container-10071956521233-template--23382620668177__multi_collection_slider_jEja39 img').srcset = selectedVariantImage.src;
document.querySelector('.variant-img-container-10071956521233-template--23382620668177__multi_collection_slider_jEja39 .secondary-image-hover').classList.add('hidden');
} else {
if(selectedVariant.featured_image){
document.querySelector('.variant-img-container-10071956521233-template--23382620668177__multi_collection_slider_jEja39 img').src = selectedVariant.featured_image.src;
document.querySelector('.variant-img-container-10071956521233-template--23382620668177__multi_collection_slider_jEja39 img').srcset = selectedVariant.featured_image.src;
document.querySelector('.variant-img-container-10071956521233-template--23382620668177__multi_collection_slider_jEja39 .secondary-image-hover').classList.add('hidden');
}
}
})
"
@option-updated="
$nextTick(() => {
$event.stopPropagation();
for(variant in productVariants){
if(productVariants[variant].options[$event.detail.index - 1] == $event.detail.option && productVariants[variant].options[$event.detail.colorIndex - 1] == selectedVariant.options[$event.detail.colorIndex - 1]){
if(productVariants[variant].available) {
selectedVariant = productVariants[variant];
if(hasJeansLogic){
document.querySelectorAll('.jeans-length-swatch-t-shirt-6').forEach((swatch) => {
swatch.classList.remove('border-black')
});
$event.target.classList.add('border-black');
} else {
document.querySelectorAll('.size-swatch-t-shirt-6').forEach((swatch) => {
swatch.classList.remove('border-black')
});
$event.target.classList.add('border-black');
};
}
break
}
}
})
"
>