//// Extracting the Product ID var productIds = []; // Check if the 'ecommerce' object and 'checkout' action exist in the data layer if (dataLayer[0] && dataLayer[0].ecommerce && dataLayer[0].ecommerce.checkout) { // Iterate through the products in the 'checkout' action dataLayer[0].ecommerce.checkout.products.forEach(function(product) { // Push the product ID to the array productIds.push(product.id); }); } // Now, the 'productIds' array contains the product IDs from the data layer console.log("Product ID:", productIds); // Extracting the Item ID var itemId; if (window.dataLayer && window.dataLayer.length > 0) { var ecommerceData = window.dataLayer[0].ecommerce; if (ecommerceData && ecommerceData.detail && ecommerceData.detail.products && ecommerceData.detail.products.length > 0) { itemId = ecommerceData.detail.products[0].id; } } console.log("Item ID:", itemId); // Extracting the event ID var eventIdElement = document.querySelector('.thanks-item span'); // Check if the element is found if (eventIdElement) { var eventId = eventIdElement.textContent.trim(); console.log("Event ID:", eventId); } else { console.error("Span element not found"); } // تحديد العنصر الذي يحتوي على النص var accordionTitle = document.querySelector('.accordion-title'); // تعديل النص accordionTitle.textContent = 'وصف المنتج'; // تحديد العنصر الذي يحتوي على نص "تخصيص المنتج" var accordionTitle = document.querySelector('.details-accordion .accordion-title'); // تعديل النص accordionTitle.textContent = 'الالوان و المقاسات '; // استهداف العنصر الذي يحتوي على الشعار في الصفحة الفرعية document.addEventListener('scroll', function() { var scrollPosition = window.scrollY; // Example: Change image when scrolling down by 10 pixels if (scrollPosition >= 10) { document.querySelector('.navbar-brand img') .src = 'https://cdn.salla.sa/VPDOd/sSVI7BIYKSpUdolGfuodCudWB0RKjYi0deUnzWHi.png'; } else { document.querySelector('.navbar-brand img') .src = 'https://cdn.salla.sa/VPDOd/sSVI7BIYKSpUdolGfuodCudWB0RKjYi0deUnzWHi.png'; } }); console.log(scrollPosition)