').val(option).html(option);
selector.append(newOption);
}
//console.log(availableOptionsJas);
jQuery('#callBackVariant .swatches-select[data-option-index="' + selectorIndex + '"] .basel-swatch').each(function() {
//console.log('sdffsdfds');
if (jQuery.inArray($(this).attr('data-value'), availableOptions) !== -1) {
$(this).removeClass('jas_unavailable')
}
else {
$(this).addClass('jas_unavailable')
}
});
jQuery('#callBackVariant .swatches-select[data-option-index="' + selectorIndex + '"] .basel-swatch').each(function() {
//console.log('sdffsdfds');
if (jQuery.inArray($(this).attr('data-value'), availableOptionsJas) !== -1) {
$(this).removeClass('jas_soldout')
}
else {
$(this).addClass('jas_soldout')
}
});
if (jQuery.inArray(initialValue, availableOptions) !== -1) {
selector.val(initialValue);
}
selector.trigger('change');
};
Shopify.linkOptionSelectors = function(product) {
// Building our mapping object.
for (var i=0; i 1) {
var key = variant.option1;
Shopify.optionsMap[key] = Shopify.optionsMap[key] || [];
Shopify.optionsMap[key].push(variant.option2);
Shopify.optionsMap[key] = Shopify.uniq(Shopify.optionsMap[key]);
}
// Gathering values for the 3rd drop-down.
if (product.options.length === 3) {
var key = variant.option1 + ' / ' + variant.option2;
Shopify.optionsMap[key] = Shopify.optionsMap[key] || [];
Shopify.optionsMap[key].push(variant.option3);
Shopify.optionsMap[key] = Shopify.uniq(Shopify.optionsMap[key]);
}
}
if (variant.available) {
// Gathering values for the 1st drop-down.
Shopify.optionsMapJas['root'] = Shopify.optionsMapJas['root'] || [];
Shopify.optionsMapJas['root'].push(variant.option1);
Shopify.optionsMapJas['root'] = Shopify.uniq(Shopify.optionsMapJas['root']);
// Gathering values for the 2nd drop-down.
if (product.options.length > 1) {
var key = variant.option1;
Shopify.optionsMapJas[key] = Shopify.optionsMapJas[key] || [];
Shopify.optionsMapJas[key].push(variant.option2);
Shopify.optionsMapJas[key] = Shopify.uniq(Shopify.optionsMapJas[key]);
}
// Gathering values for the 3rd drop-down.
if (product.options.length === 3) {
var key = variant.option1 + ' / ' + variant.option2;
Shopify.optionsMapJas[key] = Shopify.optionsMapJas[key] || [];
Shopify.optionsMapJas[key].push(variant.option3);
Shopify.optionsMapJas[key] = Shopify.uniq(Shopify.optionsMapJas[key]);
}
}
}
// Update options right away.
Shopify.updateOptionsInSelector(0);
if (product.options.length > 1) Shopify.updateOptionsInSelector(1);
if (product.options.length === 3) Shopify.updateOptionsInSelector(2);
// When there is an update in the first dropdown.
jQuery("#callBackVariant .single-option-selector:eq(0)").change(function() {
Shopify.updateOptionsInSelector(1);
if (product.options.length === 3) Shopify.updateOptionsInSelector(2);
return true;
});
// When there is an update in the second dropdown.
jQuery("#callBackVariant .single-option-selector:eq(1)").change(function() {
if (product.options.length === 3) Shopify.updateOptionsInSelector(2);
return true;
});
};
var product = {"id": 8777391800494,"title": "P35C Raglan Long Sleeve Vest With Fuzzy Collar \u0026 Front Zip (Unisex)","handle": "p35c-raglan-long-sleeve-vest-with-fuzzy-collar-front-zip","price": 76000,"price_min": 76000,"price_max": 76000,"available": true,"price_varies": false,"compare_at_price": null,"compare_at_price_min": 0,"compare_at_price_max": 0,"compare_at_price_varies": false,"variants": [{"id": 46616267489454,"title": "xs / blu","option1": "xs","option2":"blu","option3":null,"sku": "P35C-BLU-XS","requires_shipping": true,"taxable": false,"featured_image":{"id": 40047203647662,"product_id": 8777391800494,"width": 2048,"height": 2048,"src": "\/\/snorkeling-gear.com\/cdn\/shop\/files\/P35C-BLU.jpg?v=1750669658"},"available": true,"public_title": "xs / blu","options": ["xs","blu"],"price": 76000,"weight": 300,"compare_at_price": null,"inventory_quantity": 1,"inventory_management": "shopify","inventory_policy": "deny","barcode": null},{"id": 46616267522222,"title": "xs / yel","option1": "xs","option2":"yel","option3":null,"sku": "P35C-YEL-XS","requires_shipping": true,"taxable": false,"featured_image":{"id": 40047203745966,"product_id": 8777391800494,"width": 1600,"height": 2400,"src": "\/\/snorkeling-gear.com\/cdn\/shop\/files\/P35C.jpg?v=1750669658"},"available": true,"public_title": "xs / yel","options": ["xs","yel"],"price": 76000,"weight": 300,"compare_at_price": null,"inventory_quantity": 1,"inventory_management": "shopify","inventory_policy": "deny","barcode": null},{"id": 46616267554990,"title": "s / blu","option1": "s","option2":"blu","option3":null,"sku": "P35C-BLU-S","requires_shipping": true,"taxable": false,"featured_image":{"id": 40047203647662,"product_id": 8777391800494,"width": 2048,"height": 2048,"src": "\/\/snorkeling-gear.com\/cdn\/shop\/files\/P35C-BLU.jpg?v=1750669658"},"available": true,"public_title": "s / blu","options": ["s","blu"],"price": 76000,"weight": 300,"compare_at_price": null,"inventory_quantity": 10,"inventory_management": "shopify","inventory_policy": "deny","barcode": null},{"id": 46616267587758,"title": "s / yel","option1": "s","option2":"yel","option3":null,"sku": "P35C-YEL-S","requires_shipping": true,"taxable": false,"featured_image":{"id": 40047203745966,"product_id": 8777391800494,"width": 1600,"height": 2400,"src": "\/\/snorkeling-gear.com\/cdn\/shop\/files\/P35C.jpg?v=1750669658"},"available": true,"public_title": "s / yel","options": ["s","yel"],"price": 76000,"weight": 300,"compare_at_price": null,"inventory_quantity": 10,"inventory_management": "shopify","inventory_policy": "deny","barcode": null},{"id": 46616267620526,"title": "m / blu","option1": "m","option2":"blu","option3":null,"sku": "P35C-BLU-M","requires_shipping": true,"taxable": false,"featured_image":{"id": 40047203647662,"product_id": 8777391800494,"width": 2048,"height": 2048,"src": "\/\/snorkeling-gear.com\/cdn\/shop\/files\/P35C-BLU.jpg?v=1750669658"},"available": true,"public_title": "m / blu","options": ["m","blu"],"price": 76000,"weight": 300,"compare_at_price": null,"inventory_quantity": 10,"inventory_management": "shopify","inventory_policy": "deny","barcode": null},{"id": 46616267653294,"title": "m / yel","option1": "m","option2":"yel","option3":null,"sku": "P35C-YEL-M","requires_shipping": true,"taxable": false,"featured_image":{"id": 40047203745966,"product_id": 8777391800494,"width": 1600,"height": 2400,"src": "\/\/snorkeling-gear.com\/cdn\/shop\/files\/P35C.jpg?v=1750669658"},"available": true,"public_title": "m / yel","options": ["m","yel"],"price": 76000,"weight": 300,"compare_at_price": null,"inventory_quantity": 10,"inventory_management": "shopify","inventory_policy": "deny","barcode": null},{"id": 46616267686062,"title": "l / blu","option1": "l","option2":"blu","option3":null,"sku": "P35C-BLU-L","requires_shipping": true,"taxable": false,"featured_image":{"id": 40047203647662,"product_id": 8777391800494,"width": 2048,"height": 2048,"src": "\/\/snorkeling-gear.com\/cdn\/shop\/files\/P35C-BLU.jpg?v=1750669658"},"available": true,"public_title": "l / blu","options": ["l","blu"],"price": 76000,"weight": 300,"compare_at_price": null,"inventory_quantity": 10,"inventory_management": "shopify","inventory_policy": "deny","barcode": null},{"id": 46616267718830,"title": "l / yel","option1": "l","option2":"yel","option3":null,"sku": "P35C-YEL-L","requires_shipping": true,"taxable": false,"featured_image":{"id": 40047203745966,"product_id": 8777391800494,"width": 1600,"height": 2400,"src": "\/\/snorkeling-gear.com\/cdn\/shop\/files\/P35C.jpg?v=1750669658"},"available": true,"public_title": "l / yel","options": ["l","yel"],"price": 76000,"weight": 300,"compare_at_price": null,"inventory_quantity": 10,"inventory_management": "shopify","inventory_policy": "deny","barcode": null},{"id": 46616267751598,"title": "xl / blu","option1": "xl","option2":"blu","option3":null,"sku": "P35C-BLU-XL","requires_shipping": true,"taxable": false,"featured_image":{"id": 40047203647662,"product_id": 8777391800494,"width": 2048,"height": 2048,"src": "\/\/snorkeling-gear.com\/cdn\/shop\/files\/P35C-BLU.jpg?v=1750669658"},"available": true,"public_title": "xl / blu","options": ["xl","blu"],"price": 76000,"weight": 300,"compare_at_price": null,"inventory_quantity": 10,"inventory_management": "shopify","inventory_policy": "deny","barcode": null},{"id": 46616267784366,"title": "xl / yel","option1": "xl","option2":"yel","option3":null,"sku": "P35C-YEL-XL","requires_shipping": true,"taxable": false,"featured_image":{"id": 40047203745966,"product_id": 8777391800494,"width": 1600,"height": 2400,"src": "\/\/snorkeling-gear.com\/cdn\/shop\/files\/P35C.jpg?v=1750669658"},"available": true,"public_title": "xl / yel","options": ["xl","yel"],"price": 76000,"weight": 300,"compare_at_price": null,"inventory_quantity": 10,"inventory_management": "shopify","inventory_policy": "deny","barcode": null},{"id": 46616267817134,"title": "2xl / blu","option1": "2xl","option2":"blu","option3":null,"sku": "P35C-BLU-2XL","requires_shipping": true,"taxable": false,"featured_image":{"id": 40047203647662,"product_id": 8777391800494,"width": 2048,"height": 2048,"src": "\/\/snorkeling-gear.com\/cdn\/shop\/files\/P35C-BLU.jpg?v=1750669658"},"available": true,"public_title": "2xl / blu","options": ["2xl","blu"],"price": 76000,"weight": 300,"compare_at_price": null,"inventory_quantity": 10,"inventory_management": "shopify","inventory_policy": "deny","barcode": null},{"id": 46616267849902,"title": "2xl / yel","option1": "2xl","option2":"yel","option3":null,"sku": "P35C-YEL-2XL","requires_shipping": true,"taxable": false,"featured_image":{"id": 40047203745966,"product_id": 8777391800494,"width": 1600,"height": 2400,"src": "\/\/snorkeling-gear.com\/cdn\/shop\/files\/P35C.jpg?v=1750669658"},"available": true,"public_title": "2xl / yel","options": ["2xl","yel"],"price": 76000,"weight": 300,"compare_at_price": null,"inventory_quantity": 10,"inventory_management": "shopify","inventory_policy": "deny","barcode": null}],"featured_image": "\/\/snorkeling-gear.com\/cdn\/shop\/files\/P35C-BLU.jpg?v=1750669658","options": ["Size","Color"]};
var $addToCartForm = $('#callBackVariant form[action="/cart/add"]');
if (window.MutationObserver && $addToCartForm.length) {
if (typeof observer === 'object' && typeof observer.disconnect === 'function') {
observer.disconnect();
}
var config = { childList: true, subtree: true };
var observer = new MutationObserver(function() {
Shopify.linkOptionSelectors(product);
observer.disconnect();
});
observer.observe($addToCartForm[0], config);
}