I updated my Magento version to recently.

After updated to new version, if I select the price of the product, that cost is showing normally fine till here.

The main problem is if I select any option like color, size That product's price is showing ZERO.

  • 3
    Why You offer bounty if you already have an answer – Murtuza Zabuawala Nov 30 '16 at 12:42

The code posted in the accepted answer cannot be found in a default Magento install.

Thus I'm pretty sure the issue can be caused by the JavaScript method called reloadPrice.

Interestingly, when checking the block that renders the attribute dropdown you can find this:

if (!$this->getSkipJsReloadPrice()) {
    $extraParams .= ' onchange="opConfig.reloadPrice()"';

I'm pretty sure you can set that parameter via layout XML by doing this:

    <reference name="product.info.options">
        <action method="setData">

I have found the solution for this issue. First of all, we need to go to this path

app/design/[your package]/[yourtheme]/template/catalog/product/view/options.phtml

Search for this script

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

Replace with

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

Now it is cleared.

  • I couldn't find this line. – user1240207 Aug 2 '16 at 4:40
  • @user1240207, have you searched for price += parseFloat(config[optionId][element.getValue()]); ? – Teja Bhagavan Kollepara Aug 3 '16 at 4:49
  • Yes, definitely I did search for it in – user1240207 Aug 3 '16 at 5:26
  • Okay, Can you share the code of your file at app/design/[your package]/[yourtheme]/template/catalog/product/view/options.phtml? – Teja Bhagavan Kollepara Aug 3 '16 at 5:37
  • 1
    @SyedIbrahim, please check once my answer. I added the path also. Or else, Please share the code from above path – Teja Bhagavan Kollepara Apr 27 '19 at 7:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.