Limit Title Characters on Product Listing Page

  • Posts: 81
  • Thank you received: 6
11 years 4 months ago #80561

The code you gave me links the Brand and Title without a Space so if the product name is : "PBH 2100 SRE 550W Hammer Drill"

With the Brand Name: BOSCH

Result is: BOSCHPBH 2100 SRE 550W Hammer Drill

Where it should be: BOSCH PBH 2100 SRE 550W Hammer Drill

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
11 years 4 months ago #80602

Then, just add a space.
Instead of:
echo $manufacturer->category_name;
echo substr($this->row->product_name, 0, 30);

do like that:
echo $manufacturer->category_name. ' ';
echo substr($this->row->product_name, 0, 30);

The following user(s) said Thank You: foxy3433

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

  • Posts: 39
  • Thank you received: 0
10 years 2 months ago #144575

Hi in product page shows some products and i am find code in file listing_img_title.php where shows product name like this echo $this->row->product_name; and i want select product names where product_name language = english so how i can select this can you give me code please?

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

  • Posts: 2334
  • Thank you received: 403
10 years 2 months ago #144599

Hi there,

I don't understand what you said and I don't think it's related to the topic. Could you be a bit more specific?
Products don't have a specific language so I can't see what you want to do.
Display product which only have english names? Since there is no variable for that it will require a custom field.

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

  • Posts: 223
  • Thank you received: 26
  • Hikashop Business
2 years 11 months ago #332199

This can also be done with css now
Here is how you can limit the title to 1, 2 or more rows.

.hikashop_product_name{
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* number of lines to show */
  -webkit-box-orient: vertical;
}

The following user(s) said Thank You: nicolas

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

Time to create page: 0.095 seconds
Powered by Kunena Forum