-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JS error on product page Cannot read property 'oldPrice' of undefined #7959
Comments
I'm also getting this after upgrading a client from 2.1.2 to 2.1.3. From playing around a light bit of debugging, I've found the following lines were introduced in 2.1.3, and is where the error comes from.
Taking a look a what
Now, the reason why this returns My (current) solution, to get around this, is to override in the theme, and abort before code mentioned above is executed. Which looks like this:
Of course, this means the state of This is specific commit, which includes links to the github tickets it was resolving: eb2ec29 |
@ashsmith workaround did the job for me. |
Confirmed. 2.1.4. 2 user selectable attributes. In my case, Color (swatch) size (dropdown). If you only select swatch, JS error (and product image does not change)... BUT if you select dropdown AND then swatch, no JS error.. And it changes product image.. Tested in environment: production. |
Can't reproduce on current magento:develop branch. |
Same issue Magento 2.1.5 download from Github adding the code snippet about worked for me too ` if (!result) {
|
We just upgraded to v2.1.5 and can still reproduce this issue. |
Same here 👎 |
same issue... just posting so I can watch this issue Also, this is ALWAYS an issue in Configurable products where no attribute can be defaulted thus all options have no values on page load |
Another quick fix:
|
I tested crantron@a84852b and the price is not updating as options are selected/even after all options are selected... I have both swatches and normal dropdown attributes on my configurable product EDIT: it was a by-product of me moving the product.info.price element to a different area of the page... would by nice if the JS worked for changing the price regardless of where the price is rendered... though it does occur to me that form elements might not work so well outside the form :) |
Confirming this issue still occurs on 2.1.6, environment: default. Clicking color swatch doesn't update product image. It's not until after clicking the size, associated product image updates. Using Chrome developer console, JS error (Uncaught TypeError: Cannot read property 'oldPrice' of undefined) triggers each time a swatch is clicked. See screenshot for full error>>> https://www.screencast.com/t/fXpFIEo4 Posting to follow. |
Hi Magento Team, |
Hi, @OZZlE and I will work on it. |
Fixed with: 269c215 |
@dreamworkers thank you for research. Could you please apply the fix 269c215 (which was done for Thank you |
Looks like this issue was already fixed in develop & 2.1-develop branches. I think we need to close it. |
@ihor-sviziev thank you for your comment |
Internal ticket to track issue progress: MAGETWO-69541 |
Preconditions
Steps to reproduce
Expected result
Actual result
Trace:
swatch-renderer.js:694 Uncaught TypeError: Cannot read property 'oldPrice' of undefined
at $.(anonymous function).(anonymous function)._UpdatePrice (http://magento213.loc/pub/static/version1482569607/frontend/Magento/luma/en_US/Magento_Swatches/js/swatch-renderer.js:694:23)
at $.(anonymous function).(anonymous function)._UpdatePrice (http://magento213.loc/pub/static/version1482569607/frontend/Magento/luma/en_US/jquery/jquery-ui.js:402:25)
at $.(anonymous function).(anonymous function)._OnClick (http://magento213.loc/pub/static/version1482569607/frontend/Magento/luma/en_US/Magento_Swatches/js/swatch-renderer.js:532:25)
at $.(anonymous function).(anonymous function)._OnClick (http://magento213.loc/pub/static/version1482569607/frontend/Magento/luma/en_US/jquery/jquery-ui.js:402:25)
at HTMLDivElement. (http://magento213.loc/pub/static/version1482569607/frontend/Magento/luma/en_US/Magento_Swatches/js/swatch-renderer.js:482:32)
at HTMLDivElement.dispatch (http://magento213.loc/pub/static/version1482569607/frontend/Magento/luma/en_US/jquery.js:4624:9)
at HTMLDivElement.elemData.handle (http://magento213.loc/pub/static/version1482569607/frontend/Magento/luma/en_US/jquery.js:4292:28)
2.1. if I click on next swatch (color), error is not occurred (in other words when all options/swatches are chosen)
2.2. there was no such error on 2.1.2
The text was updated successfully, but these errors were encountered: