Skip to content
document.addEventListener('DOMContentLoaded', function() {
// Runs a lightweight check to catch Swatch King items as they load in
setInterval(function() {
// Find all swatch lists that we haven't counted yet
var swatchLists = document.querySelectorAll('variant-king-combined-listing .swatch-view:not(.tumi-counted)');
swatchLists.forEach(function(list) {
list.classList.add('tumi-counted'); // Mark as processed so we don't count it twice
var swatches = list.querySelectorAll('li.swatch-view-item');
var totalSwatches = swatches.length;
// If there are extra variants, create the +X button
if (totalSwatches > 1) {
var remaining = totalSwatches - 1;
// Find the product URL so clicking the number routes to the PDP
var productCard = list.closest('.product-block');
var productUrl = productCard ? productCard.querySelector('a.product-link').href : '#';
var countElement = document.createElement('a');
countElement.href = productUrl;
countElement.className = 'tumi-mobile-swatch-count';
countElement.innerText = '+' + remaining;
// Drop it right next to the first swatch!
list.appendChild(countElement);
}
});
}, 800); // Checks every 0.8s (zero performance hit)
});