Porto Theme - Product Images not loading

Good day. There is an installation Magento 2.2.5. Theme - Porto. On the product page don’t load the image. Error :

Uncaught SyntaxError: Unexpected token , in JSON at position 2043
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:3232)
at Object.add [as done] (jquery.js:3291)
at jQuery.fn.init.jQuery.fn.ready (jquery.js:3542)
at jQuery.fn.init (jquery.js:2967)
at new jQuery.fn.init (jquery-migrate.js:225).

How to fix it ?

This error message doesn’t really tell us much.

  • Is it only the Product Image that doesn’t display?
  • Is this displayed on the page or in the Inspect Element Console?

Also, check Porto for patches. There was definitely an issue somewhere with 2.2.5 and images. I just can’t remember what it was exactly. But I’m sure there was a patch because I also use Porto.

Thanks. Problem solved - applied the wrong patch.

1 Like

Hi Andrey! I am on M2.3.4 and Porto 3.2.2 and having the same error. Patched as per their instruction multiple times - and still stuck. Could you share what patched need to be applied and what you had been doing wrong? the instruction is not very clear. I applied 23x, 231and above, 233 and 2xx patch for product detail

Hi,

For M 2.3.3 & 2.3.4 please use the following patches.

Make sure you don’t lose any files during the upload.

1 Like

Thank you! it is so not obvious from their FAQ and troubleshooter) The culprit is gallery.phtml but it took me ages to find that out

just so i get this right, “no need to patch” means “no need to apply extra patches compared to 2.3.3”, right? but all the 2.2.x, etc do need to be applied)

Install theme files an 2 patch. Theme Files\Magento 2.x\Patch for Magento 2.2.x And Above.zip and Theme Files\Magento 2.x\Patch for Magento 2.3.3.zip . Then :
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

Hi @moorka and welcome,

Yes, the Porto Documentation isn’t very clear if you’ve never done it before. Based on your environment, just upload the content of the following 3 patches (it’s ok to overwrite existing files):

  1. Porto Folder/Theme Files/Magento 2.x/Patch for Magento 2.3.1 and Above.zip
  2. Porto Folder/Theme Files/Magento 2.x/Patch for Magento 2.3.3.zip
  3. Porto Folder/Theme Files/Magento 2.x/Patch for Magento 2.3.x.zip

I believe…

  1. Fixes something on a Product Page
  2. Fixes something with the Filters
  3. Fixes something in the checkout

(Albeit, I could be wrong as it’s been a while) I just wish their labelling convention was clearer.

thanks a lot, this worked!

Let me know pls how you get on with the configuration and if you had to change files/directories permission in order to make your design changes show in the frontend.

Frankly, i have only managed to get my design to show correctly on one of my storeviews, still working on the other one.

But in terms of product images not showing, what worked is following the order on the support screenshot you posted earlier in this conversation.

I have also had to delete the configed CSS pub/media/porto/configed_css/design_default.css as per PortoTheme troubleshooter and save design config from Magento admin.

But for now i have one stroreview working fine https://siccaro.eu/de/ and one storeview missing some of the CSS https://siccaro.eu/.

In terms of permissions, I followed Craig’s respective video.

I am facing same issue product images not showing on the product view page. i have applied the patches still its not showing the images. magento 2 version is 2.3.5p1. waste lot of time on this but its not working after applying the patches.

Hi @Dattatray_Yadav and welcome.

You’ll need to include more information to narrow down your issue, For example:

  • Did they used to show before? If yes, then when did they stop showing?
  • Are you using the Porto theme? If yes, does this issue still persist when using the default Luma theme?