BASK IN YOUR JOY

Khám phá bộ sưu tập sen tắm

jQuery(function () { function generateSelect(id) { // Gets all filters. var $options = jQuery('#' + id + ' .e-filter'); // Hides the default Elementor filters. $options.hide(); // Reorders filters so the "All" option is the first one. // $options.find('button[data-filter="__all"]').prependTo($options); // Creates the select. jQuery('').appendTo('#' + id + ' .elementor-widget-container'); // Collect options, excluding "__all", and sort them in descending order based on numerical value var optionsArray = $options.find('button[data-filter!="__all"]').map(function () { return { value: jQuery(this).attr("data-filter"), text: jQuery(this).text() }; }).get().sort(function (a, b) { return b.value - a.value; }); // Add "__all" option first // jQuery("", { // "value": "__all", // "text": "All categories" // }).appendTo('#select-' + id); // Loops through the sorted filters and adds them to the select. jQuery.each(optionsArray, function (index, item) { jQuery("", { "value": item.value, "text": item.text }).appendTo('#select-' + id); }); // Adds an event to the select so it triggers a click to the appropriate filter when an option is selected. jQuery('#select-' + id).change(function () { var selectedFilter = jQuery(this).find("option:selected").val(); jQuery('#' + id + ' .e-filter button[data-filter="' + selectedFilter + '"]').click(); }); } // Generates the select for the following Taxonomy filters. generateSelect('products-filter-mobile'); }); window.onload = function () { let params = new URLSearchParams(document.location.search); if (params.has("e-filter-065a16d-product_categories")) { let yop = params.get("e-filter-065a16d-product_categories"); let selectElem = document.getElementById('products-filter-mobile'); selectElem.value = yop; selectElem.dispatchEvent(new Event("change")); } }

Visit GROHE Facebook

Visit GROHE Instagram