`;
// 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");
}
}
function applyTagBadges(productElement, product) {
// Find the sale sign wrapper
const saleSignWrapper = productElement.querySelector('.ls-sale-sign-wrap');
if (!saleSignWrapper) return;
// Clear existing content but keep the wrapper element
saleSignWrapper.innerHTML = '';
// Make sure the wrapper is visible
saleSignWrapper.style.display = 'block';
const badges = [];
// Standard sale badge
if (product.compare_at_price > product.price && product.available) {
badges.push('Sale ');
}
// Sold out badge
if (!product.available) {
badges.push('Sold out ');
}
// Process tags
if (product.tags && Array.isArray(product.tags)) {
product.tags.forEach(originalTag => {
const tag = originalTag.toLowerCase();
if (tag === 'price-drop') {
badges.push('Price drop ');
} else if (tag === 'clearance') {
badges.push('Clearance ');
} else if (tag === 'short-dated') {
badges.push('Short dated ');
} else if (tag === 'vitamarts-pick') {
badges.push('Vitamart\'s pick ');
} else if (tag === 'special-order') {
badges.push('Special order ');
} else if (tag === 'vitamart-exclusive') {
badges.push('Vitamart exclusive ');
} else if (tag === 'coming-soon') {
badges.push('Coming soon ');
} else if (tag === 'best-value') {
badges.push('Best value ');
} else if (tag === 'limited-edition') {
badges.push('Limited edition ');
} else if (tag === 'staff-favorite') {
badges.push('Staff favorite ');
} else if (tag === 'save-10') {
badges.push('Save 10% ');
} else if (tag === 'save-10-dollars') {
badges.push('Save $10 ');
} else if (tag === 'save-20') {
badges.push('Save 20% ');
} else if (tag === 'low-price') {
badges.push('Low price ');
} else if (tag === 'discontinued') {
badges.push('Discontinued ');
} else if (tag === 'new') {
badges.push('New ');
} else if (tag === 'promo') {
badges.push('3 for $15 ');
} else if (tag === 'back-in-stock') {
badges.push('Back in stock ');
} else if (tag === 'bogo') {
badges.push('1+1 bogo ');
} else if (tag === 'view-price-in-cart') {
badges.push('View price in cart ');
} else if (tag === 'free-item') {
badges.push('Free item ');
} else if (tag === 'characteristic:made in canada') {
badges.push(' ');
}
});
}
// Add badges content to the wrapper, even if empty
saleSignWrapper.innerHTML = badges.join('\ ');
// Add a class to the wrapper to designate it as using badges format
saleSignWrapper.classList.add('ls-badges-container');
// Hide if no badges
if (badges.length === 0) {
saleSignWrapper.style.display = 'none';
}
}
Skip to content
RXBAR RXBAR is a brand that produces protein bars. RXBAR protein bars are known for their simple and transparent ingredient lists, typically featuring egg whites, nuts, and dates as the main components. RXBAR protien bars gained popularity for promoting a "no B.S." (no nonsense) approach to their supplements, meaning they strive to use minimal and recognizable ingredients.
Choosing a selection results in a full page refresh.
Opens in a new window.
{"themeColor":"#574CD5","iconColor":"#574CD5","showLogo":true,"topBottomPosition":10,"rightLeftPosition":10,"iconSize":"small","iconCustomSize":64,"position":"middle-right"}