PERHATIAN❗Setiap order akan dipos keesokan harinya selepas order dibuat ❗
Close
Home
Shop
Hayla Monogram
Bawal Floral
Instant Bawal Floral
Hayla Floral
Latest Collection
Clearance Sales Only
Cart
RM
0.00
0
✨ Worn by Icons, Made for You.
Shop by Category
Shop Now
Shop Now
Shop Now
Shop Now
Official Boutique Hayla Heejab !
© 2023 clothify. All Rights Reserved.
0
0
Your Cart
Your cart is empty
Return to Shop
jQuery(document).ready(function($) { // Your variation images mapping var variationImages = { 'bidang-50': 'http://haylaheejab.shop/wp-content/uploads/2025/06/photo_6338817781650278581_y.jpg', 'Bidang 50': 'http://haylaheejab.shop/wp-content/uploads/2025/06/photo_6338817781650278581_y.jpg' }; var currentVariationImage = null; // Debug: Find all possible image selectors console.log('=== DEBUGGING IMAGE SELECTORS ==='); console.log('woocommerce-product-gallery img:', $('.woocommerce-product-gallery img').length); console.log('product-gallery img:', $('.product-gallery img').length); console.log('single-product img:', $('.single-product img').length); console.log('product-images img:', $('.product-images img').length); console.log('wp-post-image:', $('.wp-post-image').length); console.log('attachment-woocommerce_single:', $('.attachment-woocommerce_single').length); // List all img elements on page $('img').each(function(index) { if ($(this).attr('src') && $(this).attr('src').includes('uploads')) { console.log('Image ' + index + ':', $(this).attr('class'), $(this).attr('src')); } }); // Listen for WooCommerce variation selection $(document).on('found_variation', 'form.cart', function(event, variation) { console.log('Variation found:', variation); if (variation.attributes && variation.attributes['attribute_size']) { var sizeValue = variation.attributes['attribute_size']; console.log('Size selected:', sizeValue); if (variationImages[sizeValue]) { console.log('Replacing product image with:', variationImages[sizeValue]); currentVariationImage = variationImages[sizeValue]; // Try multiple selectors var selectors = [ '.woocommerce-product-gallery img', '.wp-post-image', '.attachment-woocommerce_single', '.product-gallery img', '.single-product img', '.product-images img', 'img[src*="uploads"]' ]; var imageChanged = false; selectors.forEach(function(selector) { var elements = $(selector); if (elements.length > 0) { console.log('Found ' + elements.length + ' elements with selector: ' + selector); elements.each(function() { if ($(this).attr('src') && $(this).attr('src').includes('uploads')) { console.log('Changing image:', $(this).attr('src'), 'to:', variationImages[sizeValue]); $(this).attr('src', variationImages[sizeValue]); $(this).attr('srcset', ''); imageChanged = true; } }); } }); if (!imageChanged) { console.log('NO IMAGES WERE CHANGED - Check selectors above'); } } } }); // SIMPLE FIX: Keep checking and reapplying the variation image setInterval(function() { if (currentVariationImage) { $('img[src*="uploads"]').each(function() { if ($(this).attr('src') !== currentVariationImage) { $(this).attr('src', currentVariationImage); $(this).attr('srcset', ''); } }); } }, 500); // Clear current variation when reset $(document).on('reset_data', 'form.cart', function() { currentVariationImage = null; }); });