0

Surely this is possible Magento...💩

I have searched the internet for a while and read the docs here and here.

I have a multistore setup. One of the stores has billions of products. One of the stores is new and has 4 products.

I want to run "catalog:images:resize" for my new store only. Running it on all stores will take disgustingly long / forever. (I have tried - It runs for many hours then the whole thing stops [before it got to the images I wanted to be refreshed] because of a 'file xyz does not exist' error)

Because I have updated the product images, and some knockout.js stuff is still using the old images. I have cleared all caches etc. (including pub/static/frontend var/cache var/generation var/page_cache etc.) I don't want to delete the whole of "pub/media/catalog/product/cache" as all the other stores correct images are in here.

I have deleted the old images from " "pub/media/catalog/product/x/y/z/". I hoped this might force a regeneration but they just 404 now. It's impossible to find where in the cache folder the product images of interest are, there are so so many folders and sub folders. Is there any way of finding which folder my old images are in so I can delete it?

How can I get rid of the old cached image being used by knockout.js? :/

Is there really no way to run catalog:images:resize on a store level?!?

Should I just delete the whole of "pub/media/catalog/product/cache"? Is that safe to do?

EDIT: The actual cause of my particular issue was a configurable product trying to use it's child products image... I have updated all the child product images and is fixed.

But my question of 'can you run catalog:images:resize on a store level' still remains...

Cheers

1 Answer 1

1

In Magento2 catalog:images:resize doesn't have any option available. but you can perform a bit hacky solution through which you can achieve this thing.

To enable image resizing of a specific store use the following steps.

  • On the Admin sidebar, tap Stores. Then under Settings, choose
  • Configuration. Tap Advanced. Then choose System.
  • To enable, make sure Enable Frontend Resize is set to "Yes"
  • And disable Frontend Resize is set to "No" to other stores.
  • save config, flush cache

Then run the command "php bin/magento catalog:images:resize" after resizing images revert all the changes.

1
  • Unfortunately this workaround does not work, as 'Enable Frontend Resize' config is not available on a store scope, at least on the site I'm working on...
    – 00-BBB
    Commented Mar 9, 2020 at 12:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.