Skip to content
- Choosing a selection results in a full page refresh.
document.addEventListener("DOMContentLoaded", function() {
// Replace with the page URLs or conditions where you want to hide the chat button
var currentPath = window.location.pathname;
// Example of pages where chat should be hidden
var pagesToExclude = [
'/collections/sale', // Adjust with the path to your specific page
'/cart', // Exclude chat from the cart page
'/checkout' // Exclude chat from the checkout page
];
if (pagesToExclude.includes(currentPath)) {
// Hides the Zendesk chat button
if (window.zE) {
zE('webWidget', 'hide');
}
} else {
// Shows the Zendesk chat button on other pages
if (window.zE) {
zE('webWidget', 'show');
}
}
});