I use Magento 2.3.4 and I have a problem with Porto Theme at product page. Images not loading and in console I have the following errors:
*Uncaught SyntaxError: Unexpected token , in JSON at position 2821*
* at JSON.parse (<anonymous>)*
* at getNodeData (scripts.js:87)*
* at Array.map (<anonymous>)*
* at scripts.js:117*
* at HTMLDocument.apply (main.js:70)*
* at fire (jquery.js:3238)*
* at Object.add [as done] (jquery.js:3297)*
* at jQuery.fn.init.jQuery.fn.ready (jquery.js:3548)*
* at jQuery.fn.init (jquery.js:2973)*
* at new jQuery.fn.init (jquery-migrate.js:241)*
I had the same problem on Sunday so it’s not isolated.
Is there a special order to these patches?
If you’re on 2.3.4 do you just patch with the 2.3’s?
Just making sure I’m not doing something daft!
According to the Porto Theme Comments Page, others have also reported the same “Uncaught SyntaxError” issue.
If I recall correctly, there was a patch that addressed the image loading issue due to a compatibility issue with Magento 2.3.x. I believe you’ll find this post of use: Porto Theme - Product Images not loading
And I’m still at a loss as to what I’m supposed to be patching as I’ve done the 2.3’s without success.
Am I supposed to be patching at all as Magento 2.3.4 as the other page says not?
Just the ones I mentioned above. The only other issues I’ve found similar to your own appear to have been resolved after uploading the aforementioned patches.
It’s logical to conclude that the patch that fixes this issue is the new details.phtml file above. If you’re already overriding this file in a child theme then you’ll also need to upload a copy of this file to that location too. This could explain why uploading the patched file is having no affect - Because Magento isn’t reading that particular file. Example:
I’m not getting any further on this. I’m on Mage 2.3.4
I’ve downloaded a fresh version of Porto and uploaded Porto Theme.
I’ve then patched with…
2.3.x
2.3.1
2.3.3
But am still getting the wheel of dots.
I’ve entered the following…
php bin/magento setup:upgrade
php bin/magento indexer:reindex
php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento setup:static-content:deploy -f
Without any change.
I’ve installed Patch for product detail 2.0.x
Still no change.
The error is…
Uncaught SyntaxError: Unexpected token , in JSON at position 1766
at JSON.parse ()
at getNodeData (scripts.js:87)
at Array.map ()
at scripts.js:117
at HTMLDocument.apply (main.js:70)
at fire (jquery.js:3238)
at Object.add [as done] (jquery.js:3297)
at jQuery.fn.init.jQuery.fn.ready (jquery.js:3548)
at jQuery.fn.init (jquery.js:2973)
at new jQuery.fn.init (jquery-migrate.js:241)
I’m sure I’m not this bad at installing extensions so something is going wrong.
On that point, I’ve never had such a problem uploading files as I have with this extension with multiple failed transfers. Don’t know if its due to the folder name length but on the new download I put it in a very short name directory and it only failed on one file.
Please upload all required theme patches mentioned in theme package to your site directory (from Patch for Magento 2.2.x > patch for Magento 2.3.1 & above)
I solved the problem after I installed the following patch:
Patch for Magento 2.2.x And Above
Patch for Magento 2.2.4 And Above
In conclusion for Magento 2.3.4 you need to install Patch for product detail 2.0.x Patch for Magento 2.2.x And Above Patch for Magento 2.2.4 And Above Patch for Magento 2.3.1 And Above Patch for Magento 2.3.3 And Above Patch for Magento 2.3.x