(function() {const configuration = {}; const fragmentElement = document.querySelector('#fragment-4361e8ad-48a9-a3bd-25a3-b78a02516f1e'); const fragmentEntryLinkNamespace = 'bsli'; const fragmentNamespace = 'bsli'; const layoutMode = 'view'; function clearPriceValue() { // Select all the span elements with the class price-value let spans = document.querySelectorAll("p.card-price"); let mainPriceContainer = document.querySelector(".mt-3.price-container.row"); let mainPriceContainerVal = document.querySelector(".col.mx-3.price-value")?.innerHTML; if(mainPriceContainerVal?.includes(' 0 DA') || mainPriceContainerVal?.includes(' 0 ')){ mainPriceContainer.style.display = "none"; } // Loop through the span elements for (let span of spans) { // Get the HTML content of the span element let html = span.innerHTML; // Check if the HTML contains '0 DA' or console.log('html ', html); if (html == ' 0 DA ' || html == ' \u0660 DA ' || html == '0 DA' || html == 'DA 0' || html == '\u0660 DA' || html.startsWith('0 ')) { // Set the innerHTML property to an empty string span.style.display = "none"; span.textContent = ''; let parent = span.parentNode; parent.removeChild(span); } else{ let grandParent = span.parentNode?.parentNode?.parentNode?.parentNode?.parentNode; // console.log('elseeeee 2 grandParent', grandParent, grandParent.querySelectorAll("img")); if(grandParent.querySelectorAll("img").length > 1){ var child = grandParent.querySelector("img"); child.style.display = "none"; // console.log('elseeeee 2 ', child.style.display); } } } } // Call the function clearPriceValue(); ;}());