Andrejkov Posted June 24, 2024 Share Posted June 24, 2024 Hello, I need the products without images to be displayed at the end of the list on the category page. I am looking for an option similar to the one provided by the Faceted search module (Unavailable products at the end). How can this be achieved? Regards. Link to comment Share on other sites More sharing options...
AddWeb Solution Posted June 24, 2024 Share Posted June 24, 2024 Hi, Identify Template or Module Responsible for Product Listing. Modify product sorting logic: Inside the template file, find the section where products are fetched and displayed (usually involves a loop over product items). Modify the sorting logic to prioritize products with images and move products without images to the end of the list. For Example: {foreach $products as $product} {if $product->has_images} {* Display product with image *} {else} {* Store products without images in a separate array or variable *} {/if} {/foreach} {* Display products without images at the end *} {foreach $products_without_images as $product} {* Display product without image *} {/foreach} Clear the cache and test. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now