tiduz Posted March 21, 2012 Share Posted March 21, 2012 Hi all, I've got a problem using presta shop core module "search" After clicking search button, it displays products according to my keyword But I want to limit the display name of each product to 10 and replace the rest with "...." Because if the name is too long, the container block takes more spaces than other.... Can you guys help me where to change this condition??? I don't know the whole structure of prestashop module..... Link to comment Share on other sites More sharing options...
tiduz Posted March 22, 2012 Author Share Posted March 22, 2012 Can you guys help me?? Link to comment Share on other sites More sharing options...
Guest aritali Posted March 22, 2012 Share Posted March 22, 2012 Ok, this is how the search works. It actually loads your product-list.tpl. So if you wanted to have a different search than your product list page you would need to copy your product-list.tpl file and name it something new, like product_searches.tpl. Then open your search.tpl and look for this line, {include file="$tpl_dir./product-list.tpl" products=$search_products} Change that file to your new products_searches.tpl name. Now open the product_searches.tpl and look for this line. <h3>{if isset($product.new) && $product.new == 1}<span class="new">{l s='New'}</span>{/if}<a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.name|escape:'htmlall':'UTF-8'}">{$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'}</a></h3> Where it says truncate:35'... that is how many characters it will display before it displays the 3 periods. Just change that to 10. Link to comment Share on other sites More sharing options...
tiduz Posted March 22, 2012 Author Share Posted March 22, 2012 Ok, this is how the search works. It actually loads your product-list.tpl. So if you wanted to have a different search than your product list page you would need to copy your product-list.tpl file and name it something new, like product_searches.tpl. Then open your search.tpl and look for this line, {include file="$tpl_dir./product-list.tpl" products=$search_products} Change that file to your new products_searches.tpl name. Now open the product_searches.tpl and look for this line. <h3>{if isset($product.new) && $product.new == 1}<span class="new">{l s='New'}</span>{/if}<a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.name|escape:'htmlall':'UTF-8'}">{$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'}</a></h3> Where it says truncate:35'... that is how many characters it will display before it displays the 3 periods. Just change that to 10. it works..... thanks man.... Link to comment Share on other sites More sharing options...
Guest aritali Posted March 22, 2012 Share Posted March 22, 2012 No problem, good luck with your shop. 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