Jump to content

how to fully display products name on the "featured products" and "gategores"?


Recommended Posts

Dear everyone, can anyone can help me fix this problem?

 

there are 3 pictures, first temp01.jpg is my nutritional product in "featured products" on the homepage; second temp02.jpg is my nutritional product in one selection of the "gategores"; the third temp03.jpg is when you click the product, the product detail page; for example, my product name is "CANADIAN DEEP SEA FISH OIL 1000 MG 200 SOFTGELS", how come this information can only fully display in the third picture, mean in the product detail page, but on the "featured products" and "gategores" both of them can not fully display, only display part of them, is any one can help me fix this problem, I want it can be display fully both in the "featured products" and "gategores", thanks everyone, this is really important for my web. thanks.

post-339778-0-52689700-1333839334_thumb.jpg

post-339778-0-17360500-1333839335_thumb.jpg

post-339778-0-83675100-1333839335_thumb.jpg

Link to comment
Share on other sites

For 'Featured Products' go to your Theme folder > Modules > homefeatured. You need to open up and edit 'homefeatured.tpl'

 

Around line 41 find this:

<h5><a href="{$product.link}" title="{$product.name|truncate:50:'...'|escape:'htmlall':'UTF-8'}">{$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'}</a></h5>

 

Now, either remove '|truncate:50:' or change the number to a higher one.

 

I'll have a look at categories for you when I get a few minutes spare.

Link to comment
Share on other sites

I think for the category list you need to go to your Theme folder and open up 'product-list.tpl'

 

Around line 42 find this:

<h3><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>

 

And do exactly the same as I described in my previous post. Hope this helps :)

Link to comment
Share on other sites

sorry, I don't know if I did something wrong, but both do not work,

 

the homefeatured.tpl content like this:

 

<h5><a href="{$product.link}" title="{$product.name|truncate:32:'...'|escape:'htmlall':'UTF-8'}">{$product.name|truncate:27:'...'|escape:'htmlall':'UTF-8'}</a></h5>

 

 

the 'product-list.tpl' content like this:

 

<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>

 

 

so I don't know how to do it, please help me, thanks.

Link to comment
Share on other sites

Where it says '|truncate:35' change that number to a higher one, like 100 for example.

 

Also, make sure you are editing the files from your theme folder (eg. your_theme > modules > homefeatured > homefeatured.tpl)

 

Finally, if you still don't see any changes, check your back office Preferences > Performance and turn on 'Force Compile' then refresh your page again.

Link to comment
Share on other sites

thank you very much! it did fixed. but sorry, I do get another problem: you can see the attach files below, in the "Featured Products" on the homepage, the "long" name of the product now can fully display , but it overlap on the "short description" of the product, how can do to give the long name of the product a little bit more space, to make the name and short description can not overlap, would you mind help me, thank you very much!

post-339778-0-62834700-1333983393_thumb.jpg

Link to comment
Share on other sites

Go to your theme folder and open up global.css

 

Find this on line 949:

 

#center_column div.products_block div.product_desc { margin: 0  5px }

 

And change to this:

 

#center_column div.products_block div.product_desc { margin: 18px 5px }

Link to comment
Share on other sites

thank you very much! it did work I change it to 40px, it can display a pretty long name, sorry, my I ask you another question? you can see the attach file below, the change from 0 to 40px make the products picture become to longer, is that possible we can change the "space between the short description and the small picture ( the picture at bottom of each product picture) of the product" become shorter? so we can make the whole product picture change to shorter to make the homepage looks better, I don't know if we can do it, please check it, thanks.

post-339778-0-43612400-1333986684_thumb.jpg

Link to comment
Share on other sites

Yeah, sorry forgot about that.

 

Go to the same bit of code as before:

 

#center_column div.products_block div.product_desc { margin: 40px 5px }

 

And change to this:

 

#center_column div.products_block div.product_desc { margin: 40px 5px 0}

Link to comment
Share on other sites

  • 3 weeks later...

Hi! I also have an issue with the product names on the home featured page. I edited the truncate as shown above, but I was wondering if it's also possible to truncate the product name to a fixed number of lines (1 or 2) instead of a number of characters? Now some products have a product name of 1 line and others of 2 lines, causing the "View" buttons not to line up correctly.

Link to comment
Share on other sites

  • 4 weeks later...

Bumping this up:

 

Is it possible to:

truncate the product name to a fixed number of lines (1 or 2) instead of a number of characters? Now some products have a product name of 1 line and others of 2 lines, causing the "View" buttons not to line up correctly.

 

See example:

 

post-328086-0-13011200-1337504981_thumb.jpg

Link to comment
Share on other sites

  • 11 months later...
  • 7 months later...
  • 1 year later...

I cannot find the truncate code on my homefeatured.tpl file. please help. I did manage to change it in productlist.tpl though. Im using prestashop 1.6 and the url of the website is miamipartysupply.com Ive tried several fivver friends who have also tried but failed. For the life of me i cannot get the full product name to come out on the featured products section of the homepage! Here is the whole page code for my homefeatured.tpl file!

{*
* 2007-2014 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:
* 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-2014 PrestaShop SA
*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*}
{if isset($products) && $products}
{include file="$tpl_dir./product-list.tpl" class='homefeatured tab-pane' id='homefeatured'}
{else}
<ul id="homefeatured" class="homefeatured tab-pane">
<li class="alert alert-info">{l s='No featured products at this time.' mod='homefeatured'}</li>
</ul>
{/if}
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...