Show variants not in stock
Guide to display out-of-stock variants in your theme so customers can see the full range and possibly sign up for stock notifications.
For example, if you have a profile with 6 sizes, but only 3 are in stock, only the 3 available are normally shown. You can change your theme to show all variants - even the out of stock ones.
Default behavior
By default, Shoporama only shows variants that are in stock. Out of stock variants are hidden to avoid confusion.
Show all variants
To show all variants (including out of stock), you need to change the product loop in your theme. In your Smarty theme, change:
<{foreach $product->getVariants() as $variant}> <!-- Use getVariants() instead of getAvailableVariants() --> <option value="<{$variant->getId()}>" <{if !$variant->getStock()}>disabled<{/if}> > <{$variant->getTitle()}> <{if !$variant->getStock()}> (Sold out)<{/if}> </option> <{/foreach}>
Styling of out of stock variants
- Add disabled to out of stock variants so they cannot be selected
- Display the text (Out of stock) after the variant name
- Use a muted color or strikethrough for out of stock variants
Combine with stock notification
For out of stock variants, you can offer the customer to receive an email when the item is back in stock.
Tip to use
Showing out-of-stock variants gives the customer an overview of the entire range and can motivate them to wait for restocking.
Do you need help? Contact us at support@shoporama.dk.
Related articles
Optimizing images for mobile
Guide to using responsive images with srcset in your Shoporama theme to provide optimized images for mobile users.
Extended fields
Learn how to use Shoporama extended fields to add extra content to your products, categories and pages - defined by your theme.
Stock notification: Notify your customers when items are back in stock
Learn how to set up email notifications so your customers can be notified when out-of-stock products are restocked in your Shoporama online store.