Show certain number of letters of the product name

  • Posts: 81
  • Thank you received: 0
10 years 1 month ago #227839

-- url of the page with the problem -- : www.bordia.de/trennscheiben/metall-trennscheiben/aluminium.html
-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3.4.8

Hi Hikashop Team,
Is it possible in the category the product name to display only 50 characters? To ensure that all divs have the same format..

Please Log in or Create an account to join the conversation.

  • Posts: 4820
  • Thank you received: 654
  • MODERATOR
10 years 1 month ago #227844

Hello,

HikaShop don't have option to do this, but you can use some custom Css!
For this, how reach your Css files AND create a custom Css, go here and here

At the end of your Css file (more easy to find it, later), use this kind of code :

span.hikashop_product_name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

Maybe, you have to be more specific on your selector (in order to be applied only on your required page
Hope this will help you,

Regards,

Last edit: 10 years 1 month ago by Philip.

Please Log in or Create an account to join the conversation.

  • Posts: 81
  • Thank you received: 0
10 years 1 month ago #228001

Great, thank you.
I've already tried to display two lines of the product name. But that did not work.

span.hikashop_product_name
{ font-weight: bold;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 500px;
}
.txt-overflow {
position: relative;
height: 3.6em;
line-height: 1.2em;
}
.txt-overflow:after {
content: "";
text-align: right;
position: absolute;
bottom: 0;
right: 0;
width: 35%;
height: 1.2em;
background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1) 50%);
}

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
10 years 1 month ago #228015

Hello,
In your case the best solution will probably be to directly edit the "listing_img_title" file of the "Product" view of your front-end template via "Hikashop->Display->Views" and change that line :

echo $this->row->product_name;
By :
echo substr($this->row->product_name, 0, 50);

Please Log in or Create an account to join the conversation.

Time to create page: 0.075 seconds
Powered by Kunena Forum