Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Description Length


lsd_se

Recommended Posts

Posted

I'm trying to lengthen the amount of characters allowed in my product description on the product listing page.

In my product_listing.php file there is this code:

 

$product_query = tep_db_query("select products_description, products_id from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . 

(int)$listing['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
     $product = tep_db_fetch_array($product_query);

      	$p_desc = substr($product['products_description'], 0, MAX_DESCR_1);
       $p_id = $product['products_id'];
/*		$list_box_contents[$cur_row][] = array('align' => $lc_align,
                                              'params' => '',
                                              'text'  => $lc_text); */

}

 

If I change the 0 in line 6 above, it still uses the same length of description, but offsets it (for example if I put 6, it starts the description at the 6th character.

 

If anyone knows how to do this please let me know!

Thanks!

Posted

I've checked out my database, and I'm not sure this is where it is done.

 

I need to change the product description length in the Product Listing Page not the Product Info Page.

 

Thanks!

Posted

The value of 'MAX_DESCR_1' needs to be increased as this is the length of the string that is returned from the offset, however, I find no such value in the default installation of 2.2rc2a.

 

If there is no option to set it in your configuration panel, either contact your template supplier or mod author or change the named value definition to an integer. 1000 should give you about a screenfull. An absurdly high number will return all up to the database table definition limit of 64k.

For ALL problems, please review this link first -> osCommerce Knowledge Base

Posted

if I change the number in 'MAX_DESCR_1' to anything other then 1, no description at all is inserted. Very odd indeed.

Posted

This is the problem with us attemtping to help you with an installation modified from the original. Something else is happening in code that I am not aware of. This is not the way that the 'substr' function should behave.

 

Please see the second sentence of my previous reply.

For ALL problems, please review this link first -> osCommerce Knowledge Base

Posted

thanks dmnalven, I'll ask the template designer what is going on with the code then, thanks or all your help/

Also a word to the wise, don't buy Template Monster templates if you plan on changing anything, a lot of the coding is messed up and only leads to endless headaches.

Archived

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

×
×
  • Create New...