Custom Options Set Price to 0 in Magento 1.7 – The Fix

I’m working on a side project with Magento… There is a bug in 1.7 where when you use custom options, and your theme doesn’t include it’s own options.phtml file, the price will set to $0 (zero) when a user selects the price.

A bunch of forum posts have people talking about the problem. Basically it’s a silly bug in the javascript in options.phtml.

Basically, if your theme doesn’t have that options file in it’s theme directory, then magento looks like it defaults to the base‘s folder and includes the “default” options.phtml.

Here is the fix. I hope Magento includes it in the next Magento release!

Line 123 of options.phtml in

Right now is

price += parseFloat(config[optionId][element.getValue()]);

Should be

price += parseFloat(config[optionId][element.getValue()].price);

Basically the code was trying to convert a javascript Object to a float… making the price 0.

Please share this page to others who experience the same issue.