Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Missing descriptions


dtchaos

Recommended Posts

When selecting one of the parent categories the description never shows, however if i select product level category the description shows fine. There may be something wrong with the query. Below is and excerpt of code where i think the problem is:

  if ($category_depth == 'nested') {
// BOF SPPC Hide categories from groups
   $category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', categories_hide_from_groups) = 0"); //this is the query where it gets the description
// EOF SPPC Hide categories from groups
   $category = tep_db_fetch_array($category_query);
?>
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading" valign="top"><?php echo (!empty($category['categories_heading_title']) ? $category['categories_heading_title'] : HEADING_TITLE); ?></td>
         </tr>
	  <tr>
           <TD COLSPAN="2" CLASS="main">
           <?php echo tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT, 'ALIGN=right'); ?>
           <?php echo $category['categories_description']; ?><!--  Here is where the description is called to display -->
		</TD>
	  </tr>

...

I'm using separate pricing per customer along with this so i think i messed up the query anyone have any ideas how to fix this? or if the error is even in this area? (sorry, this belongs under showtopic=251308 hit the wrong button when adding it)

Edited by dtchaos
Link to comment
Share on other sites

To clarify i checked the the query:

 

$category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', categories_hide_from_groups) = 0"); 

 

and it outputs only the categories_name and categories_image, even though the category does have a description. I understand a little about how the query works, but i don't understand what "c." and "cd." stuff means. Can anyone help me deconstruct this so i can rewrite it so it works?

Edited by dtchaos
Link to comment
Share on other sites

Ok i figured this out. The c and cd i guess are mysql variables of some kind that got assigned to the table(s) they represent c represents TABLE_CATEGORIES and the cd represents the TABLE_CATEGOREIS_DESCRIPTION. so by adding "cd.categories_description," to the "select" section of the query i was able to get this working again. I'm just posting this here in case someone else has the same problem.

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...