Truncate Product Name length
- in2computing
-
Topic Author
- Offline
I was wondering how to truncate the length of the Product Name on front end display.
My eshop is in2computing.com/eShop/product/listing.html
Any help would be much appreciated.
Thanks and regards
Yogi
Thanks and regards
Yogi
www.barnetpcservices.com
www.in2computing.com
Please Log in or Create an account to join the conversation.
To truncate it in the product listing, you have to edit the view "product / listing_img_title" and replace the line "echo $this->row->product_name;" by "echo substr($this->row->product_name, 0, 50);"
Where "50" is the number of char to display.
Please Log in or Create an account to join the conversation.
- in2computing
-
Topic Author
- Offline
Xavier wrote: replace the line "echo $this->row->product_name;" by "echo substr($this->row->product_name, 0, 50);"
Where "50" is the number of char to display.
Hello Xavier
Thanks for your quick response... That sorted out the problem... I have added "..." at the end of the product name as it truncates in the middle of the word...
echo substr($this->row->product_name, 0, 50)."...";
Thanks again
Thanks and regards
Yogi
www.barnetpcservices.com
www.in2computing.com
Please Log in or Create an account to join the conversation.
- in2computing
-
Topic Author
- Offline
Thanks and regards
Yogi
www.barnetpcservices.com
www.in2computing.com
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- in2computing
-
Topic Author
- Offline
Thanks and regards
Yogi
www.barnetpcservices.com
www.in2computing.com
Please Log in or Create an account to join the conversation.
It would be difficult to be more specific.
Last time you have edit the view "product | listing_img_title" and this time you should edit the view "product | cart".
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
- in2computing
-
Topic Author
- Offline
I got it sorted now. Sorry for being a bit thick earlier.
Thanks and regards
Yogi
www.barnetpcservices.com
www.in2computing.com
Please Log in or Create an account to join the conversation.
- in2computing
-
Topic Author
- Offline
Xavier wrote: Hi,
To truncate it in the product listing, you have to edit the view "product / listing_img_title" and replace the line "echo $this->row->product_name;" by "echo substr($this->row->product_name, 0, 50);"
Where "50" is the number of char to display.
This line is different in the latest version. <a href="<?php echo $link;?>" title="<?php echo $this->escape($this->row->product_name); ?>">
What do I do now please?
Thanks and regards
Yogi
www.barnetpcservices.com
www.in2computing.com
Please Log in or Create an account to join the conversation.
Instead of :
Please Log in or Create an account to join the conversation.