SHOP

function openPopup() { document.getElementById('popup-container').style.display = 'block'; } function closePopup() { document.getElementById('popup-container').style.display = 'none'; } document.getElementById('open-popup-btn').addEventListener('click', openPopup); document.getElementById('close-popup-btn').addEventListener('click', closePopup); document.getElementById('popup-overlay').addEventListener('click', closePopup); const colorMap = { 'black': '#000000', 'blue': '#0000FF', 'brown': '#A52A2A', 'champagne': '#F7E7CE', 'dark': '#555555', 'gray': '#808080', 'green': '#008000', 'grey': '#808080', 'ld': '#D5D5D5', 'mdbv': '#D5D5D5', 'mix': '#D5D5D5', 'multy': '#D5D5D5', 'orange': '#FFA500', 'pink': '#FFC0CB', 'purple': '#800080', 'red': '#FF0000', 'rsb': '#D5D5D5', 'sf': '#D5D5D5', 'violet': '#EE82EE', 'vtpl-yg': '#D5D5D5', 'white': '#FFFFFF', 'yellow': '#FFFF00' }; document.querySelectorAll('.cwi-filter-container').forEach(container => { const input = container.querySelector('input[type="checkbox"]'); const circle = container.querySelector('.circle-circle'); if (input && circle) { // Set the background color based on the mapped value const color = colorMap[input.value]; if (color) { circle.style.backgroundColor = color; } } }); // Select the container const container = document.querySelector('.price-container ul'); // Get all list items const items = Array.from(container.querySelectorAll('li')); // Define the desired order const order = [ '1-199', '200-499', '500-999', '1000-1999', '2000-4999', '5000-9999', '10000' ]; // Sort the items based on the order items.sort((a, b) => { const aValue = a.querySelector('input').value; const bValue = b.querySelector('input').value; return order.indexOf(aValue) - order.indexOf(bValue); }); // Clear the container and append sorted items container.innerHTML = ''; items.forEach(item => container.appendChild(item));
Pair of oval orange loose gemstones

SPESSARTITE GARNET 8.05ct

8.05ct, ORANGE, SPESSARTITE GARNET, OVAL, TANZANIA
SIGN UP FOR DETAILS

Oval orange loose gemstone

SPESSARTITE GARNET 4.92ct

4.92ct, ORANGE, SPESSARTITE GARNET, OVAL, TANZANIA
SIGN UP FOR DETAILS

Oval green loose gemstone

EMERALD 1.54ct

1.54ct, GREEN, EMERALD, OVAL, ZAMBIA, GWL
SIGN UP FOR DETAILS

Cushion-cut deep green loose gemstone

TOURMALINE 11.51ct

11.51ct, GREEN BLUE, TOURMALINE, CUSHION, BRAZIL
SIGN UP FOR DETAILS

Round brilliant white loose gemstones in a group

TANZANITE 39.3ct

365 PCS, VIOLET BLUE, TANZANITE, ROUND, 2.75x2.75mm, 39.3ct
SIGN UP FOR DETAILS

Round brilliant white loose gemstones, alternate view

TANZANITE 1.93ct

15 PCS, VIOLET BLUE, TANZANITE, ROUND, 2.75x2.75mm, 1.93ct
SIGN UP FOR DETAILS

Long emerald-cut green loose gemstone

TOURMALINE GREEN 21.72ct

21.72ct, GREEN, TOURMALINE GREEN, BAGUETTE, AFRICA
SIGN UP FOR DETAILS

Emerald-cut green loose gemstone, slim rectangle

TOURMALINE GREEN 34.1ct

34.1ct, GREEN, TOURMALINE GREEN, BAGUETTE, AFRICA
SIGN UP FOR DETAILS

Pair of round blue loose gemstones

SAPPHIRE 1.84ct

1.84ct, BLUE, SAPPHIRE, ROUND, SRI LANKA, GWL
SIGN UP FOR DETAILS

Emerald-cut bluish-green loose gemstone

TOURMALINE 9.89ct

9.89ct, BLUE, TOURMALINE, EMERALD, BRAZIL
SIGN UP FOR DETAILS

Emerald-cut teal green loose gemstone

TOURMALINE 7.26ct

7.26ct, BLUE, TOURMALINE, EMERALD, BRAZIL
SIGN UP FOR DETAILS

Cushion-cut pale aqua loose gemstone

AQUAMARINE 38.69ct

38.69ct, BLUE, AQUAMARINE, CUSHION, GWL
SIGN UP FOR DETAILS

Pair of cushion-cut teal green loose gemstones

TOURMALINE 15.59ct

15.59ct, GREEN BLUE, TOURMALINE, CUSHION, BRAZIL
SIGN UP FOR DETAILS

Pair of emerald-cut teal loose gemstones

TOURMALINE 7.45ct

7.45ct, GREEN BLUE, TOURMALINE, EMERALD, BRAZIL
SIGN UP FOR DETAILS

Cushion-cut bright teal loose gemstone

TOURMALINE 9.83ct

9.83ct, GREEN BLUE, TOURMALINE, CUSHION, BRAZIL
SIGN UP FOR DETAILS

Three oval pink and mauve loose gemstones

SPINEL FANCY 4.96ct

4.96ct, SPINEL FANCY, OVAL, TANZANIA
SIGN UP FOR DETAILS

Six assorted pink and green loose gemstones

CUT MIX GEMSTONES 4.68ct

4.68ct, MULTY, CUT MIX GEMSTONES, MIX SHAPE, TANZANIA
SIGN UP FOR DETAILS

Three heart-shaped lavender and blue loose gemstones

CUT MIX GEMSTONES 1.76ct

1.76ct, MULTY, CUT MIX GEMSTONES, HEART, TANZANIA
SIGN UP FOR DETAILS

Three oval yellow, blue and purple loose gemstones

SAPPHIRE FANCY 4.61ct

4.61ct, MULTY, SAPPHIRE FANCY, OVAL, SRI LANKA
SIGN UP FOR DETAILS

Three emerald-cut pink and pale green loose gemstones

CUT MIX GEMSTONES 2.65ct

2.65ct, MULTY, CUT MIX GEMSTONES, EMERALD, TANZANIA
SIGN UP FOR DETAILS

Row of oval lilac loose gemstones

SAPPHIRE PINK 4ct

4ct, PINK, SAPPHIRE PINK, OVAL, MADAGASCAR
SIGN UP FOR DETAILS

Row of four oval blue loose gemstones

SAPPHIRE 3.49ct

4 PCS, FINE BLUE, SAPPHIRE, OVAL, 3.49ct
SIGN UP FOR DETAILS

Four cushion-cut red-pink loose gemstones

TOURMALINE, RUBELLITE 14.28ct

14.28ct, PINK, TOURMALINE, RUBELLITE, CUSHION, BRAZIL
SIGN UP FOR DETAILS

Three pear-shaped hot pink loose gemstones

TOURMALINE, RUBELLITE 6.85ct

6.85ct, PINK, TOURMALINE, RUBELLITE, PEAR, BRAZIL
SIGN UP FOR DETAILS

Row of small oval red and pink loose gemstones

TOURMALINE, RUBELLITE 7.65ct

8 PCS, TOURMALINE, RUBELLITE, OVAL, 8x6mm, 7.65ct
SIGN UP FOR DETAILS

Emerald-cut bicolor pale green and peach loose gemstone

TOURMALINE, FANCY COLOR 5.39ct

5.39ct, BLUE GREEN, TOURMALINE, FANCY COLOR, EMERALD
SIGN UP FOR DETAILS

Large pear-shaped emerald-green loose gemstone

EMERALD 3.1ct

3.1ct, GREEN, EMERALD, PEAR, ZAMBIA, GWL
SIGN UP FOR DETAILS

Pair of cushion-cut green loose gemstones

TOURMALINE 6.78ct

6.78ct, GREEN, TOURMALINE, CUSHION, BRAZIL
SIGN UP FOR DETAILS

Pair of pear-shaped magenta loose gemstones

TOURMALINE, RUBELLITE 2.4ct

2.4ct, PINK, TOURMALINE, RUBELLITE, PEAR, BRAZIL, GWL
SIGN UP FOR DETAILS

Pear-shaped vivid green loose gemstone

EMERALD 2.77ct

2.77ct, GREEN, EMERALD, PEAR, ZAMBIA, GWL
SIGN UP FOR DETAILS

Pear-shaped deep forest-green loose gemstone

EMERALD 1.78ct

1.78ct, GREEN, EMERALD, PEAR, ZAMBIA, GWL
SIGN UP FOR DETAILS

Pear-shaped bright green loose gemstone, slightly included

EMERALD 2.33ct

2.33ct, GREEN, EMERALD, PEAR, ZAMBIA, GWL
SIGN UP FOR DETAILS

Pear-shaped rich green loose gemstone, elongated

EMERALD 3.42ct

3.42ct, GREEN, EMERALD, PEAR, ZAMBIA, GWL
SIGN UP FOR DETAILS

Pair of pear-shaped grey-green loose gemstones

TANZANITE FANCY COLOR 5.91ct

5.91ct, PINK, TANZANITE FANCY COLOR, PEAR, TANZANIA
SIGN UP FOR DETAILS

Pair of cushion-cut grey-lavender loose gemstones

TANZANITE FANCY COLOR 7.1ct

7.1ct, VIOLET PURPLE, TANZANITE FANCY COLOR, CUSHION, TANZANIA
SIGN UP FOR DETAILS

Pear-shaped violet-blue loose gemstone

TANZANITE FANCY COLOR 12.12ct

12.12ct, PEACH, TANZANITE FANCY COLOR, PEAR, TANZANIA, GWL
SIGN UP FOR DETAILS

Oval raspberry red loose gemstone

RUBY 2.74ct

2.74ct, RED, RUBY, OVAL, TANZANIA, GRS
SIGN UP FOR DETAILS

Pair of oval lime green loose gemstones

CHROME TOURMALINE 1.67ct

1.67ct, GREEN, CHROME TOURMALINE, MIX SHAPE
SIGN UP FOR DETAILS

Round dark blue loose gemstone

SAPPHIRE 1.07ct

1.07ct, BLUE, SAPPHIRE, ROUND, MONTANA
SIGN UP FOR DETAILS

Emerald-cut light aquamarine blue loose gemstone

AQUAMARINE 14.12ct

14.12ct, LIGHT BLUE, AQUAMARINE, EMERALD, MADAGASCAR
SIGN UP FOR DETAILS

Emerald-cut deep raspberry loose gemstone

TOURMALINE, RUBELLITE 7.79ct

7.79ct, PINK, TOURMALINE, RUBELLITE, EMERALD, BRAZIL
SIGN UP FOR DETAILS

Oval and pear-shaped pink-red loose gemstones

TOURMALINE, RUBELLITE 3.68ct

3.68ct, PINK, TOURMALINE, RUBELLITE, MIX SHAPE, BRAZIL
SIGN UP FOR DETAILS

Round orange loose gemstone

SAPPHIRE 1.09ct

1.09ct, ORANGE, SAPPHIRE, ROUND, MOZAMBIQUE, GWL
SIGN UP FOR DETAILS

Pair of cushion-cut periwinkle blue loose gemstones

TANZANITE 2.91ct

2.91ct, VIOLET BLUE, TANZANITE, CUSHION, TANZANIA
SIGN UP FOR DETAILS

Emerald-cut lavender loose gemstone

SAPPHIRE FANCY 1.02ct

1.02ct, PURPLE, SAPPHIRE FANCY, EMERALD, MADAGASCAR
SIGN UP FOR DETAILS

Cushion-cut ruby red loose gemstone

TOURMALINE, RUBELLITE 1.94ct

1.94ct, RED, TOURMALINE, RUBELLITE, SQUARE CUSHION, BRAZIL
SIGN UP FOR DETAILS

Pair of oval pink loose gemstones

SAPPHIRE FANCY 1.99ct

1.99ct, PINK, SAPPHIRE FANCY, OVAL, MADAGASCAR
SIGN UP FOR DETAILS

Oval vivid red loose gemstone

TOURMALINE, RUBELLITE 10.17ct

10.17ct, RED, TOURMALINE, RUBELLITE, OVAL, BRAZIL
SIGN UP FOR DETAILS

Elongated cushion-cut hot pink loose gemstone

TOURMALINE, RUBELLITE 2.36ct

2.36ct, PINK, TOURMALINE, RUBELLITE, CUSHION, BRAZIL
SIGN UP FOR DETAILS

Cushion-cut coral red loose gemstone

TOURMALINE, RUBELLITE 1.7ct

1.7ct, PINK, TOURMALINE, RUBELLITE, SQUARE CUSHION, BRAZIL
SIGN UP FOR DETAILS

Showing all results
<!--
-->
jQuery(document).ready(function ($) { // Add pagination click handler $(document).on("click", "#pagination a", function (e) { e.preventDefault(); var page = $(this).data("page"); jQuery("#pages").val(page); updateURLParameters(); }); $(".spinner").hide(); var urlParams = new URLSearchParams(window.location.search); urlParams.forEach(function (value, key) { var values = value.split(","); values.forEach(function (val) { $('input[name="' + key + '[]"][value="' + val + '"]').prop( "checked", true ); }); }); jQuery("body").on("click", ".blockplayvideo", function () { var $id = $(this).attr("data-id"); $("#block" + $id + " .elementor-image-box-img img").addClass("hidden"); $(".display-v-" + $id).removeClass("hidden"); $(".play-video-btn-" + $id).addClass("hidden"); $(".stop-video-btn-" + $id).removeClass("hidden"); //$('.products').find('a#play-video').addClass('hidden'); //$('.products').find('a#stop-video').removeClass('hidden'); }); jQuery("body").on("click", ".blockstopvideo", function () { var $id = $(this).attr("data-id"); $("#block" + $id + " .elementor-image-box-img img").removeClass("hidden"); $(".display-v-" + $id).addClass("hidden"); $(".play-video-btn-" + $id).removeClass("hidden"); $(".stop-video-btn-" + $id).addClass("hidden"); //$('.products').find('a#play-video').addClass('hidden'); //$('.products').find('a#stop-video').removeClass('hidden'); }); var $slider = $("#diametervalue"); var $length = $("#lengthvalue"); var $output = $("#sliderValue"); var $lengthValue = $("#lengthbar"); $output.html($slider.val()); // Display the default slider value $lengthValue.html($length.val()); // Display the default slider value $slider.on("input", function () { $output.html($(this).val()); jQuery("#pages").val(1); console.log('jQuery("#pages").val(1);'); updateURLParameters(); }); $length.on("input", function () { $lengthValue.html($(this).val()); jQuery("#pages").val(1); console.log('jQuery("#pages").val(1);'); updateURLParameters(); }); $("#sizeblock .cwi-filter-title").click(function () { $(".size-content").toggleClass("active"); }); $("#weightblock .cwi-filter-title").click(function () { $(".contentweight").toggleClass("active"); }); $("#lengthblock .cwi-filter-title").click(function () { $(".length-content").toggleClass("active"); }); $("#diameterblock .cwi-filter-title").click(function () { $(".diamter-content").toggleClass("active"); }); var currentPage = 1; var isLoading = false; var maxPages = 0; // Initial AJAX request // performAjaxRequest(currentPage); // Event listeners for filter changes $( 'input[name="accountname[]"],input[name="category[]"], input[name="gem-type[]"], input[name="shape[]"], input[name="size[]"], input[name="color[]"], input[name="treatment[]"], input[name="price[]"], input[name="origin[]"], input[name="location[]"],#weightfrom,#weightto,input[name="contentweight[]"],#lengthfrom,#lengthto,input[name="contentlength[]"],#diameterfrom,#diameterto,input[name="contentdiameter[]"],#sizefrom,#sizeto,input[name="contentsize[]"]' ).on("change", function () { jQuery("#pages").val(1); console.log('jQuery("#pages").val(1);'); updateURLParameters(); }); // Event listener for clearing filters $("#clearFiltersButton").click(function () { clearFilters(); }); // Function to clear filters function clearFilters() { $('input[name="category[]"]:checked').prop("checked", false); $('input[name="gem-type[]"]:checked').prop("checked", false); $('input[name="shape[]"]:checked').prop("checked", false); $('input[name="size[]"]:checked').prop("checked", false); $('input[name="color[]"]:checked').prop("checked", false); $('input[name="treatment[]"]:checked').prop("checked", false); $('input[name="price[]"]:checked').prop("checked", false); $('input[name="origin[]"]:checked').prop("checked", false); $('input[name="location[]"]:checked').prop("checked", false); $('input[name="contentweight[]"]:checked').prop("checked", false); $('input[name="accountname[]"]:checked').prop("checked", false); $("#weightfrom").val(""); $("#weightto").val(""); $("#diametervalue").val("1"); $("#sliderValue").html("1"); $("#lengthvalue").val("1"); $("#lengthbar").html("1"); $("#pages").val("1"); updateURLParameters(); } // Function to update URL parameters function updateURLParameters() { const current_url = new URL(window.location.href); var url = getUrlpathname(current_url); var params = []; var contentlength = getCheckedValues("contentlength[]"); if (contentlength.length > 0) params.push("contentlength=" + contentlength.join(",")); var lengthfrom = $("#lengthfrom").val(); if (lengthfrom != "") { params.push("lengthfrom=" + lengthfrom); } var lengthto = $("#lengthto").val(); if (lengthto != "") { params.push("lengthto=" + lengthto); } var contentdiameter = getCheckedValues("contentdiameter[]"); if (contentdiameter.length > 0) params.push("contentdiameter=" + contentdiameter.join(",")); var diameterfrom = $("#diameterfrom").val(); if (diameterfrom != "") { params.push("diameterfrom=" + diameterfrom); } var diameterto = $("#diameterto").val(); if (diameterto != "") { params.push("diameterto=" + diameterto); } // Collecting checked filter values var contentweight = getCheckedValues("contentweight[]"); if (contentweight.length > 0) params.push("contentweight=" + contentweight.join(",")); var weightfrom = $("#weightfrom").val(); if (weightfrom != "") { params.push("weightfrom=" + weightfrom); } var weightto = $("#weightto").val(); if (weightto != "") { params.push("weightto=" + weightto); } var gemTypes = getCheckedValues("gem-type[]"); if (gemTypes.length > 0) params.push("gem-type=" + gemTypes.join(",")); var shapes = getCheckedValues("shape[]"); if (shapes.length > 0) params.push("shape=" + shapes.join(",")); var contentsize = getCheckedValues("contentsize[]"); if (contentsize.length > 0) params.push("contentsize=" + contentsize.join(",")); var accountname = getCheckedValues("accountname[]"); if (accountname.length > 0) params.push("accountname=" + accountname.join(",")); var sizefrom = $("#sizefrom").val(); if (sizefrom != "") { params.push("sizefrom=" + sizefrom); } var sizeto = $("#sizeto").val(); if (sizeto != "") { params.push("sizeto=" + sizeto); } var colors = getCheckedValues("color[]"); if (colors.length > 0) params.push("color=" + colors.join(",")); var treatments = getCheckedValues("treatment[]"); if (treatments.length > 0) params.push("treatment=" + treatments.join(",")); var prices = getCheckedValues("price[]"); if (prices.length > 0) params.push("price=" + prices.join(",")); var origins = getCheckedValues("origin[]"); if (origins.length > 0) params.push("origin=" + origins.join(",")); var locations = getCheckedValues("location[]"); if (locations.length > 0) params.push("location=" + locations.join(",")); var pages = $("#pages").val(); if (pages != "") { params.push("page=" + pages); } var categories = getCheckedValues("category[]"); if (categories.length > 0) { params.push("category=" + categories.join(",")); } // Sorting var sort = $(".sort-by.active").data("filter"); if (sort) params.push("sort=" + sort); // Forming the URL if (params.length > 0) url += "?" + params.join("&"); else url += "?"; window.history.pushState(null, null, url); currentPage = 1; // Reset to first page when filters are updated isLoading = false; // Reset isLoading when filters are updated performAjaxRequest(currentPage); // Force AJAX request after updating URL parameters } // Function to get checked values for a given name function getCheckedValues(name) { var values = []; $('input[name="' + name + '"]:checked').each(function () { values.push($(this).val()); }); return values; } // AJAX request function function performAjaxRequest(page) { if (isLoading) { return; } isLoading = true; var url = new URL(window.location.href); url = url.toString(); $(".spinner").show(); $.ajax({ url: ajax_object.ajax_url, method: "POST", data: { action: "filter_products", url: url, page: page, }, dataType: "json", beforeSend: function () { jQuery(".loadproduct").addClass("is-loading"); jQuery( ".loadproduct .elementor-widget-container .elementor-grid" ).css("opacity", "0.5"); jQuery( ".loadproduct .elementor-widget-container .elementor-grid" ).css("background", "white"); jQuery(".loading-product-listing").show(); jQuery("body").removeClass("cwi-filter__active"); }, success: function (response) { if (response.max_num_pages) { maxPages = response.max_num_pages; } if (typeof response.grid_content !== "undefined") { if (page === 1) { jQuery( ".loadproduct .elementor-widget-container .elementor-grid" ).html(response.grid_content); jQuery("#pagination").html(response.pagination); } else { jQuery( ".loadproduct .elementor-widget-container .elementor-grid" ).append(response.grid_content); } } if (currentPage 0) { Object.keys(response.data_filter).forEach(function (key) { const items = response.data_filter[key]; $("." + key + " li small").text("(0)"); if (Array.isArray(items)) { items.forEach(function (tax) { const tagSlug = tax.tag_slug; const tagCount = tax.tag_count; const element = $(`#${tagSlug}`); if (element.length) { const smallElement = element .closest(".cwi-filter-container") .find("small"); smallElement.text(`( ${tagCount} )`); } }); } }); } else { $(".cwi-filters-form-diamond li.cwi-filter-container small").text("(0)"); // Reset all counts if no filter data } }, complete: function () { jQuery( ".loadproduct .elementor-widget-container .elementor-grid" ).css("opacity", "1"); jQuery(".loading-product-listing").hide(); jQuery(".e-loop__load-more").remove(); jQuery(".loadproduct").removeClass("is-loading"); }, error: function (response) { isLoading = false; // Reset loading state on error }, }); } // Sort button click event $(document).on("click", ".sort-by", function () { var sortFilter = $(this).data("filter"); $(".sort-by").removeClass("active"); $(this).addClass("active"); updateURLParameters(); }); // Infinite scroll $(window).scroll(function () { if ( $(window).scrollTop() + $(window).height() >= $(document).height() - 100 && !isLoading ) { //performAjaxRequest(currentPage); } }); var $ul = $(".size-container .content"); $ul .children("li") .sort(function (a, b) { var aText = $(a).find("label").text().trim(); var bText = $(b).find("label").text().trim(); var aNumber = parseFloat(aText.match(/[\d.]+/)); var bNumber = parseFloat(bText.match(/[\d.]+/)); return aNumber - bNumber; }) .appendTo($ul); function getLastUrlSegment(url) { // Create URL object to parse the URL properly let urlObj; try { urlObj = new URL(url); } catch (e) { return ""; // Return empty string if URL is invalid } // Get the pathname (e.g., "/product-category/designs/") const path = urlObj.pathname; // Split the path by '/' and filter out empty strings const segments = path.split("/").filter((segment) => segment !== ""); // Return the last segment or empty string if no segments return segments.length > 0 ? segments[segments.length - 1] : ""; } function getUrlpathname(url) { let urlObj; try { urlObj = new URL(url); } catch (e) { return ""; // Return empty string if URL is invalid } const path = urlObj.pathname; return path; } // Example usage: const current_url = new URL(window.location.href); const category = getLastUrlSegment(current_url); function checkGemTypeExists() { const urlParams = new URLSearchParams(window.location.search); return urlParams.has('gem-type'); } const gemTypeExistsx = checkGemTypeExists(); if (gemTypeExistsx) { $(".spinner").show(); var url = new URL(window.location.href); url = url.toString(); } else { var url = "https://aqgems.test/shop/page=1"; } $.ajax({ url: ajax_object.ajax_url, method: "POST", data: { action: "filter_products", url: url, page: 1, }, dataType: "json", beforeSend: function () { }, success: function (response) { if (typeof response.total_products !== "undefined") { $(".total-products").text(response.total_products); } jQuery("#pagination").html(response.pagination); if (response.data_filter && Object.keys(response.data_filter).length > 0) { Object.keys(response.data_filter).forEach(function (key) { const items = response.data_filter[key]; $("." + key + " li small").text("(0)"); if (Array.isArray(items)) { items.forEach(function (tax) { const tagSlug = tax.tag_slug; const tagCount = tax.tag_count; const element = $(`#${tagSlug}`); if (element.length) { const smallElement = element .closest(".cwi-filter-container") .find("small"); smallElement.text(`( ${tagCount} )`); } }); } }); } else { $(".cwi-filters-form-diamond li.cwi-filter-container small").text("(0)"); // Reset all counts if no filter data } jQuery(".filter-select .cwi-filter-checkbox").prop("checked", false); jQuery("#category_ #" + category).prop("checked", true); jQuery("#pages").val(1); //window.history.pushState(null, null, current_url.origin + current_url.pathname); //console.log(current_url); const gemTypeExists = checkGemTypeExists(); if (gemTypeExists) { console.log('Gem type parameter exists in the URL'); // Get the gem type values const gemTypeValues = new URLSearchParams(window.location.search).get('gem-type'); console.log('Gem types:', gemTypeValues.split(',')); jQuery( ".loadproduct .elementor-widget-container .elementor-grid" ).html(response.grid_content); Object.keys(response.data_filter).forEach(function (key) { const items = response.data_filter[key]; $("." + key + " li small").text("(0)"); if (Array.isArray(items)) { items.forEach(function (tax) { const tagSlug = tax.tag_slug; const tagCount = tax.tag_count; const element = $(`#${tagSlug}`); if (element.length) { element.prop("checked", true); const smallElement = element .closest(".cwi-filter-container") .find("small"); smallElement.text(`( ${tagCount} )`); } }); } }); $(".spinner").hide(); } else { window.history.pushState( null, null, current_url.origin + current_url.pathname ); } }, complete: function () { jQuery(".loadproduct .elementor-widget-container .elementor-grid").css( "opacity", "1" ); jQuery(".loading-product-listing").hide(); jQuery(".e-loop__load-more").remove(); jQuery(".loadproduct").removeClass("is-loading"); }, error: function (response) { isLoading = false; // Reset loading state on error }, }); });

CONTACT US

CONTACT US