$(window).on("load", function () {
var savedColumns = localStorage.getItem('selectedColumns');
var initialColumns = savedColumns ? parseInt(savedColumns, 10) : 5;
setGridColumns(initialColumns);
$('.dropdown-view .dropdown-item').on('click', function () {
var columns = $(this).data('columns'); setGridColumns(columns); localStorage.setItem('selectedColumns', columns);
});
function setGridColumns(columns) {
$('.product-list').removeClass('columns-1 columns-2 columns-3 columns-4 columns-5 columns-6').addClass('columns-' + columns);
}
});
document.querySelectorAll("article.product").forEach(function(t){let e=t.querySelectorAll(".variation-item"),a=t.querySelectorAll(".product-list-item");e.length>0&&e.forEach(function(t){t.addEventListener("click",function(){e.forEach(function(e){e.dataset.id===t.dataset.id?e.classList.add("active"):e.classList.remove("active")}),a.forEach(function(e){e.dataset.id===t.dataset.id?e.classList.add("active"):e.classList.remove("active")})})})});