rezvan Posted April 16, 2020 Share Posted April 16, 2020 I use prestashop 1.7.6.4 in home page module "ps_featuredproducts" can not stop display unavailable products. ..../modules/ps_featuredproducts i think by a code must do that such as display $product.quantity > 0 please answer this question Link to comment Share on other sites More sharing options...
Guest Posted April 16, 2020 Share Posted April 16, 2020 (edited) ./themes/your theme/modules/ps_featuredproducts/views/templates/hook/ps_featuredproducts.tpl Old: <section class="featured-products clearfix"> <h2 class="h2 products-section-title text-uppercase"> {l s='Popular Products' d='Shop.Theme.Catalog'} </h2> <div class="products"> {foreach from=$products item="product"} {include file="catalog/_partials/miniatures/product.tpl" product=$product} {/foreach} </div> <a class="all-product-link float-xs-left float-md-right h4" href="{$allProductsLink}"> {l s='All products' d='Shop.Theme.Catalog'}<i class="material-icons"></i> </a> </section> New: <section class="featured-products clearfix"> <h2 class="h2 products-section-title text-uppercase"> {l s='Popular Products' d='Shop.Theme.Catalog'} </h2> <div class="products"> {foreach from=$products item="product"} {if $product.quantity_all_versions > 0} {include file="catalog/_partials/miniatures/product.tpl" product=$product} {/if} {/foreach} </div> <a class="all-product-link float-xs-left float-md-right h4" href="{$allProductsLink}"> {l s='All products' d='Shop.Theme.Catalog'}<i class="material-icons"></i> </a> </section> Edited April 16, 2020 by Guest (see edit history) Link to comment Share on other sites More sharing options...
rezvan Posted April 16, 2020 Author Share Posted April 16, 2020 thanks for your answer I do that <section> <h1>{l s='Our Products' d='Modules.Featuredproducts.Shop'}</h1> <div class="products"> {foreach from=$products item="product"} {if $product.quantity_all_versions > 0} {include file="catalog/_partials/miniatures/product.tpl" product=$product} {/if} {/foreach} </div> <a href="{$allProductsLink}">{l s='All products' d='Modules.Featuredproducts.Shop'}</a> </section> but it doesn't work Link to comment Share on other sites More sharing options...
rezvan Posted April 16, 2020 Author Share Posted April 16, 2020 ./themes/your theme/modules/ps_featuredproducts/views/templates/hook/ps_featuredproducts.tpl {* * 2007-2016 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <[email protected]> * @copyright 2007-2016 PrestaShop SA * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} <section> <h1>{l s='Our Products' d='Modules.Featuredproducts.Shop'}</h1> <div class="products"> {foreach from=$products item="product"} {if $product.quantity > 0} {include file="catalog/_partials/miniatures/product.tpl" product=$product} {/if} {/foreach} </div> <a href="{$allProductsLink}">{l s='All products' d='Modules.Featuredproducts.Shop'}</a> </section> Link to comment Share on other sites More sharing options...
Guest Posted April 16, 2020 Share Posted April 16, 2020 Please update my previous post. Link to comment Share on other sites More sharing options...
Guest Posted April 16, 2020 Share Posted April 16, 2020 <section class="featured-products clearfix"> <h2 class="h2 products-section-title text-uppercase"> {l s='Popular Products' d='Shop.Theme.Catalog'} </h2> <div class="products"> {foreach from=$products item="product"} {if $product.quantity_all_versions > 0} {include file="catalog/_partials/miniatures/product.tpl" product=$product} {/if} {/foreach} </div> <a class="all-product-link float-xs-left float-md-right h4" href="{$allProductsLink}"> {l s='All products' d='Shop.Theme.Catalog'}<i class="material-icons"></i> </a> </section> Link to comment Share on other sites More sharing options...
rezvan Posted April 16, 2020 Author Share Posted April 16, 2020 thanks I make a mistake about follow module address i edit this file: root/modules/ps_featuredproducts/views/templates/hook/ps_featuredproducts.tpl that it is not work but your first post was correct and it's work thank you Link to comment Share on other sites More sharing options...
Guest Posted April 16, 2020 Share Posted April 16, 2020 You can rate it by clicking on the gray heart below my post. 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