Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Increasing product name field length


p51mustang

Recommended Posts

Posted

I used a free template which I modified to create my shop (www.saairforce.co.za/shop)

 

However, the product title field on the home page and category pages is too short, cutting off the full product name.

 

Please see the image attached.

 

Where do I increase the field length for the product name?

 

Thanks!

post-39270-0-13748900-1352733113_thumb.jpg

Posted

Hi there

 

You have a bit of code in one of the PHP includes that is chopping the name down to 19 characters (probably so that it will always fit in the title bar?)

 

In a standard shop you'd be looking at a file catalog/includes/modules/product_listing.php - that may differ in the template though.

 

Have a look though and see if you can see something that looks like substr($listing['products_name'],0,19) and try changing 19 to a bigger figure - screenshot attached suggests lots & lots?

 

Bob

Posted

Thanks Bob, appreciated.

 

The relevant code in product_listing.php is as follows:

case 'PRODUCT_LIST_NAME':

$lc_align = '';

if (isset($HTTP_GET_VARS['manufacturers_id'])) {

$p_name = $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . substr( $listing['products_name'],0,MAX_DESCR_NAME) . '</a>';

} else {

$p_name = $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . substr($listing['products_name'],0,MAX_DESCR_NAME). '</a>';

}

 

Changing the '0' to something else does horrible things!

Posted

Forgot to update this thread: Sorted!

 

Changed the "MAX_DESCR_NAME" to 47 which seems a good fit.

 

The file to alter the field length for the catelog was, as Bob mentioned, product_listing.php

 

The file to alter the field length for New Products on the home page was new_products.php

 

Thanks Bob!

  • 4 weeks later...
Posted

hi, i am having this same problem and can not figure out how to do this i followed cat/includ/mod/pro_list does not look like the one described?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...