Jump to content

Price attributes calculated as a percentage


Recommended Posts

I have change the file PRODUCT.JS and PRODUCT.PHP to

calcolate the price with percent of the field $attribute_price

if ( $attribute_price > 1 || $attribute_price < -1 || $attribute_price == 0){
$price += $attribute_price; } 
else {
$price = $price + ($price *(float)$attribute_price); 
}
 
Everything works well, in increst price attribute use the value 0 (50% = 0.50) 
But I can not use percentage-point why are rounded to 2 decimal places. Where I can change the code to take a (float) price of attribute ??
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...