How to Replace Placeholder Images for Products in the Storefront
The following article describes how to replace placeholder images in your custom OroCommerce application.
This topic assumes that you have previously created a custom application, a bundle, and a storefront theme, as described in the Storefront Customization topic.
Note
This tutorial is suitable for both cases, when you have created your own custom storefront theme, and when you need to change an out-of-the-box one. However, creating your own theme is recommended as it enables to manage your storefront appearance easily.
Replace a Placeholder
Place a new storefront placeholder image into your bundle`s public assets folder (e.g., Resources/public/{your_theme_id}/product/no_image.png):
Resources/public/default/product/no_image.png
Specify the main placeholder image in your theme configuration file:
image_placeholders: product: '@AcmeDemoBundle/Resources/public/default/product/no_image.png' category: '@AcmeDemoBundle/Resources/public/default/product/no_image.png'
or if files are in the same bundle with theme.yml
image_placeholders: product: '/bundles/acmedemo/default/product/no_image.png' category: '/bundles/acmedemo/default/product/no_image.png'
Rebuild the assets:
Clear the cache to reload the Yaml configuration files:
php bin/console cache:clear
Publish images to the public web folder:
php bin/console assets:install --symlink
Generate new image dimensions:
php bin/console product:image:resize-all
Note
It is also possible to replace a placeholder from the back-office under System > Configuration > Commerce > Design > Theme. Keep in mind that the changes in the back-office will prevail overriding the changes described above in this article. For more details on how to replace a placeholder in the back-office, follow the theme configuration topic.