Advertisement
Guest User

Untitled

a guest
Aug 1st, 2015
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. var baseprice = parseFloat(document.getElementById("js-price-value").getAttribute('data-base-price'));
  2. MivaEvents.SubscribeToEvent('variant_changed', function () {
  3. var additionalPricing = 0;
  4. $('#js-product-attributes select option:selected').each(function() {
  5. if ( $(this).attr('data-option-price') ) {
  6. additionalPricing = additionalPricing + parseFloat($(this).attr('data-option-price'));
  7. }
  8. });
  9. var newprice = (baseprice + additionalPricing).toFixed(2);
  10. document.getElementById("js-price-value").innerHTML = "$" + newprice;
  11. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement