News:

Support the VirtueMart project and become a member

Main Menu

I cannot change product title length

Started by Laura Chu, January 24, 2017, 01:24:54 AM

Previous topic - Next topic

Laura Chu

I need reduce products title length in case the name in one line, I changed product_name value TEXT in the database, but nothing happened. I have searched around, and followed some suggestions, but still cannot change product title length.  Please help, many thanks.
www.cybersky.com.au Website Design, Web Development, Graphic Deisgn, Display System

GJC Web Design

do it programatically with php in the display templates
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Laura Chu

Can you please tell me what's code I need add, many thanks.
www.cybersky.com.au Website Design, Web Development, Graphic Deisgn, Display System

GJC Web Design

there is already a VM function limitStringByWord() in the FE helper

call it something like   echo shopFunctionsF::limitStringByWord ($product->product_title, 4, ' ...') ;

or write your own -- there are plenty on Google

or do by css if your titles are fixed width

add a class truncate and

.truncate {
  width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Laura Chu

www.cybersky.com.au Website Design, Web Development, Graphic Deisgn, Display System