magento-configurable-simple icon indicating copy to clipboard operation
magento-configurable-simple copied to clipboard

"Price From:" initially shows correct price but when I select an option it shows 0.00

Open jmmumpower opened this issue 10 years ago • 9 comments

On the product view page of our site, www.discountsafetyvideos.com, it initially shows the correct "Price From:" but switches to 0 when an option is selected.
1 2

Also when the product it is in the cart it will have the price of the lower option. For example, one product sells for $149.95 and the kit sells for $199.95. No matter what it is showing the $149.95 in the cart.

I had this fixed but when we upgraded to 1.9 I haven't been able to get it working. I inspected element on the page and it says"Uncaught ReferenceError: Product is not defined" "scp_product_extension.js:6." I tried deleted all previous versions of scp and added the newest but can't get it to work. Any help would be appreciated.

jmmumpower avatar Jul 21 '14 21:07 jmmumpower

Hey my friend. I had the same problem and found kind a fix, but didn't really find out which change is causing this zero price bug.

Try this out:

  • open your_magento_dir/js/varien/product.js
  • search for this piece of code "price = optionPrices+parseFloat(_productPrice);"
  • enter this line before the line you found "if(!(optionPrices === undefined)) optionPrices = 0; "

If this doesn't work, try to set this line right after the "else if" or "if"-clause at the lines before.

Keep me updated please as I am trying to find out how the bug does come. Does it work for you as well ?

isisis avatar Jul 24 '14 13:07 isisis

Thanks for the reply. I put the code "if(!(optionPrices === undefined)) optionPrices = 0;" in where you said and about 5 other places within the code but i couldn't get it to work. Let me know if you have any other ideas. I appreciate it.

jmmumpower avatar Jul 24 '14 13:07 jmmumpower

I have the exact same problem and isisis solution works. He just didn't explain it correctly.

I placed this code on line 647: if(!(optionPrices === undefined)) { optionPrices = 0; }

The complete code looks like this: } else { if(!(optionPrices === undefined)) { optionPrices = 0; } price = optionPrices+parseFloat(_productPrice); priceInclTax += parseFloat(_productPrice) * (100 + this.currentTax) / 100; }

Don't forget the brackets.

JTielemans avatar Nov 05 '14 13:11 JTielemans

hi did you manage to fix this i have the same issue however mines only when you select quick add to cart (AJAX) and it opens in a fancy box pop up
untitled-1 this has been driving me nuts for mths any help would really help. the above methods obviously didnt work for me and im running scp it also works fine when go into product page prices change correctly as below untitled-2

seano1982 avatar Dec 02 '14 11:12 seano1982

Hey Seano1982, I was never able to find a solution for fancy box popups in the category view. But I do know that if you pull this info on the category page you have to integrate the different varien js files. Just like on the product page.

/varien/configurable.js /varien/product.js

JTielemans avatar Dec 02 '14 12:12 JTielemans

many thanks for the quick reply and taking the time too not to sure on what you mean there im still quite new to this i thought my web man was good till he left this mess that ive been fixing bugs for over a year now and this particular bug i just cant fix and is really important to us

seano1982 avatar Dec 02 '14 13:12 seano1982

No problem, we're all here to help.

Magento loads different javascript files per page and for the product list page some javascript files are not loading because they are not needed there. So you have to load these manually with the local.xml file.

More information can be found on this link: http://fastdivision.com/2011/10/06/diy-magento-create-a-quick-view-for-your-magento-theme/

JTielemans avatar Dec 02 '14 14:12 JTielemans

JTielemans thanks for the info you were right what i did was not in the local.xml file but the ajax.xml it was calling in product.js and configurable but not the scp-productextension.js i added this below the other js files and it works perfect thank you for the advice

seano1982 avatar Dec 03 '14 17:12 seano1982

sorry to bump and old thread, but I need some help with this as well - same setup with a fancy-box qiuckview, not pulling in the scp code and showing $0.00 after a selection is made.

After changing product.js, it's no longer showing $0.00 (it stays at the lowest price), but it's not pulling in the scp overrides (configurable rather than simple added to cart, and not pulling in the list prices from the simple products)

product.js changes:
                } else {
            if(!(optionPrices === undefined)) {
            optionPrices = 0;
            }
        price = optionPrices+parseFloat(_productPrice);
        priceInclTax += parseFloat(_productPrice) * (100 + this.currentTax) / 100;
        }

I moved scp_product_extension.js to /js/scp and then edited my theme' s local.xml to add in

<layout version="0.1.0">
<default>
    <reference name="head">
        <action method="addJs"><script>varien/product.js</script></action>
        <action method="addJs"><script>varien/configurable.js</script></action>
        <action method="addJs"><script>scp/scp_product_extension.js</script></action>              
    </reference>
    <reference name="root">
[...]

[I didn't add everything from that link]

Any help would be greatly appreciated, maybe I misunderstood the steps above

barrmy avatar Mar 14 '15 22:03 barrmy