Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Short Description - Bug


TomCavendish

Recommended Posts

Using the short description contribution here:

 

http://www.oscommerce.com/community/contributions,4452

 

When a product has no description, the word "Array" is displayed as the short description rather than nothing.

 

Anyone able to solve it?

 

 

Hello

 

The only solution I can find is this:

 

for example for new_products:

 

catalog/includes/modules/new_products.php

 

FIND this (the code of contribution of query):

 

$sql = 'SELECT `products_description` FROM `products_description` WHERE products_id ='.$new_products['products_id'].' && language_id='.(int)$languages_id;
$description_query = tep_db_query($sql);
$description = mysql_fetch_array($description_query, MYSQL_ASSOC);		
$description['products_description'] = substr($description['products_description'], 0, 100);
$desc_len = strlen($description['products_description']);
$description['products_description'][$desc_len-1] = '.';
$description['products_description'][$desc_len-2] = '.';
$description['products_description'][$desc_len-3] = '.';

 

 

ADD AFTER, this:

 

$description['products_description'] = ereg_replace("(Array)", "", $description['products_description']);

 

 

(this replace "Array" by "": no appear description, but then need change "read more" by "more info" or similar)

 

edit file:

 

catalog/includes/languages/english.php

 

 

define('DESCR_READ_MORE', '<FONT color=blue>read more</FONT>'); // ... read more.

 

REPLACE by:

 

define('DESCR_READ_MORE', '<FONT color=blue>more info +</FONT>'); // ... read more.

 

and for other lenguage: espanol: leer más. Replace by: más info

 

 

 

 

 

Then in all modificated files that add short description ADD AFTER query:

 

$description['products_description'] = ereg_replace("(Array)", "", $description['products_description']);

 

This "delete" the Array word for products without description

but I think other can do better to resolve it

Edited by nicko107
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...