Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var baseprice = parseFloat(document.getElementById("js-price-value").getAttribute('data-base-price'));
- MivaEvents.SubscribeToEvent('variant_changed', function () {
- var additionalPricing = 0;
- $('#js-product-attributes select option:selected').each(function() {
- if ( $(this).attr('data-option-price') ) {
- additionalPricing = additionalPricing + parseFloat($(this).attr('data-option-price'));
- }
- });
- var newprice = (baseprice + additionalPricing).toFixed(2);
- document.getElementById("js-price-value").innerHTML = "$" + newprice;
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement