Showing the single result
-

A convenient daily fiber powder with prebiotic fibers, digestive enzymes, probiotics and botanical support for healthy digestion and metabolism
/* Keep the quantity selector's native dropdown arrow visible. */
#lwf-ygy-regulate-daily-fiber-form select.lwf-select {
appearance: auto !important;
-webkit-appearance: menulist !important;
background-image: none !important;
cursor: pointer;
}
/* Match the standardized Mal's cart button appearance. */
#lwf-ygy-regulate-daily-fiber-form .lwf-add-to-cart {
background: #164421;
color: #fff;
font-family: 'Work Sans', sans-serif;
font-weight: 500;
text-transform: uppercase;
border-radius: 2px;
cursor: pointer;
}
(function () {
const formBox = document.getElementById('lwf-ygy-regulate-daily-fiber-form');
if (!formBox) return;
const packageSelect = formBox.querySelector('#ygy-regulate-daily-fiber-package');
const productPriceField = formBox.querySelector('#ygy-regulate-daily-fiber-productpr');
const priceDisplay = formBox.querySelector('#ygy-regulate-daily-fiber-price');
const addToCartButton = formBox.querySelector('#ygy-regulate-daily-fiber-add-to-cart');
const deliveryInputs = formBox.querySelectorAll('input[name="ygy-regulate-daily-fiber-delivery"]');
const productName = 'YGY Regulate Daily Fiber';
const packages = {
one: { sku: 'USYG70003', description: '(1) pouch / 30 packets', price: '55.95' },
two: { sku: 'USYG70003', description: '(2) pouches / 30 packets each', price: '111.90' },
three: { sku: 'USYG70003', description: '(3) pouches / 30 packets each', price: '167.85' },
four: { sku: 'USYG70003', description: '(4) pouches / 30 packets each', price: '223.80' }
};
function selectedDelivery() {
const selected = formBox.querySelector('input[name="ygy-regulate-daily-fiber-delivery"]:checked');
return selected ? selected.value : 'one-time';
}
function deliveryDescription(delivery) {
if (delivery === 'monthly') return 'autoship monthly';
if (delivery === 'two-months') return 'autoship every 2 months';
return 'one-time purchase';
}
function updateSelection() {
const selectedPackage = packages[packageSelect.value];
if (!selectedPackage) {
productPriceField.value = '';
priceDisplay.textContent = 'Select a quantity';
addToCartButton.disabled = true;
return;
}
const description = productName + ', ' + selectedPackage.description +
', SKU ' + selectedPackage.sku + ', ' + deliveryDescription(selectedDelivery());
productPriceField.value = description + ', :' + selectedPackage.price;
priceDisplay.textContent = '$' + selectedPackage.price;
priceDisplay.classList.remove('lwf-price-prompt');
addToCartButton.disabled = false;
addToCartButton.textContent = 'ADD TO CART →';
}
deliveryInputs.forEach(function (input) {
input.addEventListener('change', updateSelection);
});
packageSelect.addEventListener('change', updateSelection);
updateSelection();
})();