`;
// Replace the existing button with our new quick-add structure
const tempDiv = document.createElement('div');
tempDiv.innerHTML = quickAddHtml;
quickActionElement.innerHTML = '';
quickActionElement.classList.add('ls-add-to-cart-wrap');
quickActionElement.appendChild(tempDiv.firstElementChild);
// Add click handler to the newly created button to log activity
const button = quickActionElement.querySelector('.ls-quickview-button');
if (button) {
button.addEventListener('click', function() {
logQuickViewActivity(productId, boxType, hostPage);
});
}
}
function processPriceDisplay(productLinkElement, product) {
const priceElement = productLinkElement.querySelector(".ls-price");
if (!priceElement) return;
// Only proceed if the product price varies
if (!product.price_varies) return;
// Calculate min/max prices
let minPrice = product.price_min;
let maxPrice = product.price_max;
// Check all variants for min/max prices
for (let j = 0; j < product.variants.length; j++) {
const price = product.variants[j].price;
if (price < minPrice) minPrice = price;
if (price > maxPrice) maxPrice = price;
}
// Format prices
minPrice = "$" + (parseFloat(minPrice) / 100).toFixed(2);
maxPrice = "$" + (parseFloat(maxPrice) / 100).toFixed(2);
// Only add max price if it's not already shown
if (priceElement.innerHTML !== maxPrice) {
// Add max price element
const maximumPrice = document.createElement('span');
maximumPrice.className = 'ls-max-price';
maximumPrice.innerHTML = maxPrice;
priceElement.parentElement.appendChild(maximumPrice);
// Add class to min price
priceElement.classList.add("ls-min-price");
}
}
{"themeColor":"#574CD5","iconColor":"#574CD5","showLogo":true,"topBottomPosition":10,"rightLeftPosition":10,"iconSize":"small","iconCustomSize":64,"position":"middle-right"}