PrestaShop Product Image Fallback for Incomplete Imports
Handle missing PrestaShop product images during catalog imports and theme templates by substituting generated fallback URLs for the no-image default.
PrestaShop ships with a default no-image picture located at `img/p/en-default-{format}.jpg`. When a product has no images, the product listing and product page templates render this file. It is a generic placeholder with no product-specific information, and it looks the same for every image-less product in the catalog.
Substituting PrestaShop's default no-image with a generated placeholder URL — one that includes the product name — makes image-less products identifiable and prevents the visual monotony of a catalog filled with identical gray boxes. The change can be made at the Smarty template level or through a PrestaShop override.
PrestaShop image system
How PrestaShop picks a product image
PrestaShop stores product images in `img/p/` with a hierarchical directory structure based on the image ID. Each product can have multiple images; the cover image is the one shown in listings. When no cover image is set, `Product::getCover()` returns false, and templates fall back to the language-specific no-image file.
The no-image file is per-language. The default is `en-default-{format_name}.jpg`, where format names like `home_default`, `small_default`, `large_default`, and `thickbox_default` correspond to different resized versions. Each format has its own dimensions configured in the admin.
Bulk imports via the native import tool or third-party modules like StoreCommander often bring text content before media. Products are visible in the store during this window with no image attached.
Smarty template
Override the no-image URL in Smarty templates
PrestaShop themes use Smarty. Product listing templates (`catalog/listing/product-list.tpl`, `catalog/product/product.tpl`) build image URLs using the `$product.cover.bySize` variable. When cover is empty, the template falls through to `$urls.no_picture_image.bySize`.
Override the no-image display by checking whether the resolved image URL contains the `no-picture` path segment and substituting a generated fallback. This check works in the template without needing a PHP override.
{* catalog/listing/product-list.tpl override *}
{assign var="img_url" value=$product.cover.bySize.home_default.url|default:''}
{if $img_url && 'no-picture' notin $img_url}
<img
src="{$img_url}"
alt="{$product.name|escape:'html'}"
width="{$product.cover.bySize.home_default.width}"
height="{$product.cover.bySize.home_default.height}"
loading="lazy"
/>
{else}
{assign var="product_name_enc" value=$product.name|escape:'url'}
<img
src="https://fallback.pics/api/v1/350x350?text={$product_name_enc}"
alt="{$product.name|escape:'html'}"
width="350"
height="350"
loading="lazy"
/>
{/if} PHP override
Override getCover in a module or PHP override
For a more systematic approach, override the `getCoverWs()` static method or write a PrestaShop module that hooks into `actionProductListingResultsModifier` to post-process product image data before it reaches templates. In the hook, replace null or no-image cover entries with a generated fallback URL.
This approach centralizes the fallback logic in one PHP file rather than distributing it across every template partial that renders product images. It also applies to the webservice (API) endpoints, so third-party integrations receive the fallback URL instead of the empty no-image path.
<?php
// modules/yourmodule/yourmodule.php
class YourModule extends Module
{
public function install()
{
parent::install();
$this->registerHook('actionProductListingResultsModifier');
return true;
}
public function hookActionProductListingResultsModifier(array $params): void
{
foreach ($params['products'] as &$product) {
$cover = $product['cover'] ?? null;
$url = $cover['bySize']['home_default']['url'] ?? '';
if (empty($url) || str_contains($url, 'no-picture')) {
$name = urlencode((string)($product['name'] ?? ''));
$product['cover']['bySize']['home_default']['url'] =
"https://fallback.pics/api/v1/350x350?text={$name}";
}
}
}
} Import window
Protecting live pages during bulk imports
PrestaShop's native product import tool processes rows sequentially. When importing thousands of products, the store is live and indexed by search engines during the import. Products imported before their images are processed will appear with the no-image placeholder for hours or days.
The fallback URL approach means that during this window, product cards show a placeholder with the product name rather than an identical gray box. This is a better user experience and avoids the indexing problems that come with multiple products sharing the same image URL.
Image format sizes
Match fallback dimensions to PrestaShop image formats
PrestaShop image formats (`home_default`, `small_default`, `large_default`, `thickbox_default`) have specific dimensions configured in Design > Image Settings. Use those dimensions as the fallback URL dimensions to avoid layout shift when a real image eventually loads.
Common PrestaShop default format dimensions are: small_default 98×98, home_default 250×250, large_default 800×800, thickbox_default 800×800. Verify these in your store's admin since themes can reconfigure them.
// Fallback URLs sized for standard PrestaShop image formats
https://fallback.pics/api/v1/98x98?text=Product+Image // small_default
https://fallback.pics/api/v1/250x250?text=Product+Image // home_default
https://fallback.pics/api/v1/800x800?text=Product+Image // large_default / thickbox Resources
Further reading
For cross-platform ecommerce image fallback patterns, see the Magento 2 and BigCommerce guides.
https://fallback.pics/docs/
https://fallback.pics/placeholder-image-api/
https://fallback.pics/blog/magento-product-image-placeholder/
https://fallback.pics/blog/shopify-hydrogen-image-fallback/ Key takeaways
What to standardize before shipping
- PrestaShop uses language-specific no-image files for products without covers — detect the 'no-picture' URL segment in templates.
- Override the template using a Smarty conditional that substitutes a generated fallback URL sized to match the image format dimensions.
- For global coverage, hook into actionProductListingResultsModifier to replace no-image entries before templates render.
- Match fallback URL dimensions to the configured PrestaShop image format sizes (small_default: 98×98, home_default: 250×250).
- Deploy fallback logic before starting bulk imports so live pages are protected during the import window.
Production fallback layer
Use fallback.pics anywhere an image URL is accepted.
Start with one deterministic URL and standardize fallback behavior across your design system.