- Did you mean
-
noser pin silver oxidised
-
none pink silver oxidised
- Related search terms
-
pink color jhumka
-
Silver n golden earrings
-
pink color diamond necklace
-
oxidised jhumka peach color
-
pink color diamond neclac
// ============================================
// AJAX NAVIGATION FUNCTIONALITY
// ============================================
/**
* Initialize AJAX navigation for sorting and filtering
*/
function initAjaxNavigation() {
// Remove existing handlers to prevent duplicates
$(document).off('click.toolbarNav');
// Handle toolbar links (sorting, pagination, etc.)
$(document).on('click.toolbarNav', '.toolbar a', function(e) {
e.preventDefault();
var $link = $(this);
var url = $link.attr('href');
// Show loading indicator
$('.page-products').addClass('loading');
// console.log('Loading toolbar content:', url);
// AJAX request
$.ajax({
url: url,
type: 'GET',
dataType: 'html',
success: function(response) {
$('.page-products').removeClass('loading');
var $response = $(response);
// Update products grid
var newProducts = $response.find('.products').html();
var newToolbar = $response.find('.toolbar-products').html();
$('.products').html(newProducts);
$('.toolbar-products').html(newToolbar);
// Update browser URL without page reload
window.history.pushState({}, '', url);
// IMPORTANT: Use debounce to prevent multiple initializations
clearTimeout(window.toolbarAjaxTimeout);
window.toolbarAjaxTimeout = setTimeout(function() {
// console.log('Reinitializing after toolbar AJAX...');
initializeAll();
mage.apply();
}, 100);
},
error: function(xhr, status, error) {
$('.page-products').removeClass('loading');
console.error('Toolbar AJAX error:', error);
window.location.href = url; // Fallback to full page reload
}
});
});
}
// ============================================
// EVENT HANDLERS
// ============================================
// Close modal on close button click
$(document).on('click', '.mobile-quickview-close', function() {
closeMobileQuickView();
});
// Close modal on overlay click
$(document).on('click', '#mobile-quickview', function(e) {
if (e.target.id === 'mobile-quickview') {
closeMobileQuickView();
}
});
// Close modal on ESC key press
$(document).on('keydown', function(e) {
if (e.keyCode === 27 && isMobileQuickViewOpen) {
closeMobileQuickView();
}
});
// ============================================
// BROWSER HISTORY AND HASH HANDLING
// ============================================
/**
* HASH CHANGE HANDLING
* For deep linking to Quick View
*/
$(window).on('hashchange', function() {
var hash = window.location.hash;
if (hash.includes('quickview=')) {
var encodedUrl = hash.split('quickview=')[1];
var productUrl = decodeURIComponent(encodedUrl);
if (isMobileDevice() && !isMobileQuickViewOpen) {
openQuickViewMobile(productUrl, 'Product Quick View');
} else if (!isMobileDevice()) {
window.open(productUrl, '_blank');
history.replaceState(null, '', window.location.pathname + window.location.search);
}
} else if (!hash && isMobileQuickViewOpen) {
closeMobileQuickView();
}
});
/**
* BROWSER HISTORY HANDLING
*/
$(window).on('popstate', function(event) {
if (!window.location.hash && isMobileQuickViewOpen) {
closeMobileQuickView();
}
});
// ============================================
// AJAX COMPLETE HANDLER
// ============================================
/**
* AJAX COMPLETE HANDLER
* Reinitialize after Magento AJAX requests
*/
$(document).ajaxComplete(function(event, xhr, settings) {
// Check if this is a toolbar/sorting AJAX request
if (settings.url && (settings.url.includes('product_list_mode') ||
settings.url.includes('product_list_limit') ||
settings.url.includes('product_list_order') ||
settings.url.includes('product_list_dir') ||
settings.url.includes('cat=') || // For category filters
settings.url.includes('price=') || // For price filters
settings.url.includes('q='))) { // For search
// console.log('Magento AJAX request detected:', settings.url);
// Debounce to prevent multiple initializations
clearTimeout(window.magentoAjaxTimeout);
window.magentoAjaxTimeout = setTimeout(function() {
// console.log('Reinitializing after Magento AJAX...');
initializeAll();
}, 300);
}
});
// ============================================
// DOCUMENT READY INITIALIZATION
// ============================================
$(document).ready(function() {
// Check for Quick View in URL hash on page load
var hash = window.location.hash;
if (hash.includes('quickview=')) {
var encodedUrl = hash.split('quickview=')[1];
var productUrl = decodeURIComponent(encodedUrl);
if (isMobileDevice()) {
setTimeout(function() {
openQuickViewMobile(productUrl, 'Product Quick View');
}, 300);
} else {
window.open(productUrl, '_blank');
history.replaceState(null, '', window.location.pathname + window.location.search);
}
}
// Initialize all functionality
initializeAll();
// ============================================
// SORTING OPTIONS SPECIFIC FIX - ONLY THIS PART ADDED
// ============================================
// Magento's sorter dropdown change
$(document).on('change', '[data-role="sorter"]', function() {
// Wait for Magento's AJAX to complete
setTimeout(function() {
// Reinitialize load more after sorting
if (typeof window.reinitializeLoadMore === 'function') {
window.reinitializeLoadMore();
}
}, 1500);
});
// Items per page change
$(document).on('change', '[data-role="limiter"]', function() {
setTimeout(function() {
if (typeof window.reinitializeLoadMore === 'function') {
window.reinitializeLoadMore();
}
}, 1500);
});
// Sort direction change
$(document).on('click', '[data-role="direction-switcher"]', function(e) {
e.preventDefault();
setTimeout(function() {
if (typeof window.reinitializeLoadMore === 'function') {
window.reinitializeLoadMore();
}
}, 1500);
});
// ============================================
// END OF SORTING SPECIFIC FIX
// ============================================
});
// ============================================
// GLOBAL FUNCTIONS
// ============================================
/**
* GLOBAL REINITIALIZATION FUNCTION
* Can be called from other scripts
*/
window.reinitializeLoadMore = function() {
initializeAll();
};
});
Sign In
Registered Customers
Create New Account
Sign In With OTP
Enter phone number.
We will send an otp on this number via SMS
Sign In with OTP
Enter OTP
Sign In With Otp
Sign In For Product Restock Notification
Enter phone number.
We will send an otp on this number via SMS
Verify Otp
Create New Account