3

I updated my Magento version to 1.9.2.2 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.

1
  • 3
    Why You offer bounty if you already have an answer Commented Nov 30, 2016 at 12:42

2 Answers 2

1
+100

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:

<catalog_product_view>
    <reference name="product.info.options">
        <action method="setData">
            <name>skip_js_reload_price</name>
            <value>true</value>
        </action>
    </referencen>
</catalog_product_view>
4

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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