Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

product_info.php and html_output.php Altering


MrStatic

Recommended Posts

Posted

Ok so I am writing my own live price updater since the one found in the contributions didn't work with my radio buttons that I use instead of a drop down menu. Now my javascript needs to read the 'value' tag and have the prefix and the value of the attribute (option) in that value tag, If I change that would it somehow mess with the cart? The code I use for the loop is as follows. Basically I don't know how to change the output to have the value like I want it and also not sure if that would break the cart.

 

<script type="text/javascript">

var Price = <?php echo ltrim($products_price, "$"); ?>;

function test() {

var SubTotal = Price;

getRadios = document.getElementsByTagName("input")

for (x=0; x < getRadios.length; x++) {
if ( getRadios[x].type == "radio" && getRadios[x].checked )
SubTotal += +getRadios[x].value;
}
document.getElementById('currentprice').innerHTML = SubTotal;

}

  • 11 months later...
Posted

Ok so I am writing my own live price updater since the one found in the contributions didn't work with my radio buttons that I use instead of a drop down menu. Now my javascript needs to read the 'value' tag and have the prefix and the value of the attribute (option) in that value tag, If I change that would it somehow mess with the cart? The code I use for the loop is as follows. Basically I don't know how to change the output to have the value like I want it and also not sure if that would break the cart.

 

 

 

Do you mind sharing how you managed to convert drop down list to radio buttons? I need that for attribute options.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...