cancel
Showing results for 
Search instead for 
Did you mean: 

No product images in product view

SOLVED

No product images in product view

I've see the other post related to this issue and have done the following:

 

checked php_value memory_limit    is 756M

changed image attribute scope for Base, Small, Thumbnail, Swatch to Global

file permissions look ok

 

I've also seen another post that references an error in the gallery (gallery.phtml or GD Library), but the solution link in that post isn't working. When I upload an image, I also don't get the choice to select from the media library or upload, it just goes straight to my local machine for upload, even if there is already an image file uploaded. I've used Magento 1 and I'm learning that Magento 2 is not really that similar.

 

Image shows on category view, as well as home page featured image and product page featured image

https://blueplanetphoto.com/store/classes.html 

 

No images show on product page, just the spinner keeps spinning

https://blueplanetphoto.com/store/basic-camera-operation.html 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: No product images in product view

After more digging, I discovered this forum post:

https://community.magento.com/t5/Magento-2-x-Technical-Issues/products-not-showing-in-category-on-fr...

I reindexed and cleaned and cleared the cache according to the solution for what appears to have been the exact issue I'm having, and it worked. 

 

Now I'm suspecting the indexing plugin I installed and its effectiveness. I'm going to mark this as solved.

View solution in original post

15 REPLIES 15

Re: No product images in product view

Hello @blueplanetphoto 

 

It is throwing error in console, I think it is due to Content Security Policies (CSP), Content Security Policies (CSP) are a powerful tool to mitigate against Cross Site Scripting (XSS) and related attacks, including card skimmers, session hijacking, clickjacking, and more.

You can find more on :

https://devdocs.magento.com/guides/v2.3/extension-dev-guide/security/content-security-policies.html

Solution :
To completely disable CSP you can also try :

php bin/magento module:disable Magento_Csp
Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy

Re: No product images in product view

Hi @blueplanetphoto 

kindly refer below link:
https://www.simicart.com/blog/magento-images-not-showing/#:~:text=Solution%3A%20You%20should%20open%...

It will help you to resolve issue.

If issue resolve, please click on 'Kudos' & Accept as Solution!

Problem solved? Click Accept as Solution!

Re: No product images in product view

I don't think I'm going to disable those security measures. If Magento has this issue, why isn't it fixed and why are we using it?

Re: No product images in product view

These are the steps I referred to in my post. I apparently need a different solution that also doesn't require disabling security features.

Re: No product images in product view

@blueplanetphoto 

 

I agree with your words, but this we are doing to debug if it is working after disabling that module, so if this issue is because of that module then we can debug in that direction.

 

Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy

Re: No product images in product view

disabled CSP, but did not fix the issue. re-enabled CSP.

Re: No product images in product view

I also installed https://github.com/Anantkprajapati/AKP_CSP

which also did not fix the issue

 

Re: No product images in product view

@blueplanetphoto 

 

Hoping that you've already run below commands after disabling module :

 

php bin/magento setup/upgrade

php bin/magento setup:di: compile

php bin/magento setup:static-content:deploy -f

php bin/magento c:f

chmod -R 777 var/ generated/ pub/media/ pub/static/

 

also after doing all these things, open your website in incognito

check errors in network tab

 

Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy

Re: No product images in product view

The product page still does not load images. 

 

These are the issues now being shown in Developer on https://www.blueplanetphoto.com/basic-camera-operation.html

 

jquery-migrate.js:45 JQMIGRATE: jQuery.attrFn is deprecated

jquery-migrate.js:45 JQMIGRATE: jQuery.fn.load() is deprecated

 

Uncaught SyntaxError: Unexpected token , in JSON at position 3125
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've also added a second product, which does not join the first product on the Featured Products block on the cart homepage (https://www.blueplanetphoto.com/store/) (the first product remains to fill the 4 spaces allocated in that block) and doesn't appear on the category page (https://www.blueplanetphoto.com/store/classes.html), but can be brought up on the specific product page (with the same no images load issue) at https://www.blueplanetphoto.com/store/photo-I.html