Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Catergory Description


sumario

Recommended Posts

Posted

Hi,

 

What i am looking for is the ability to give each catergoy a description, which will then appear when you go to a catergory above the product list for that catergory.

 

If there is a way to do this, please point me in the right direction.

 

Thank you.

Posted

Hi again,

 

This works well but one problem.

 

It works perfectly when creating a new catergory and inputting a description. the description appears as well.

But, i get an error when i try to edit any catergory. Even if it has a description i still get the same error.

 

This is the error (it appears in the admin panel when i try to edit the cat)

 

Fatal error: Call to undefined function: tep_get_category_description() in /home/bedmaker/public_html/cart/catalog/admin/categories.php on line 914

 

This is line 914 from that file:

 

		  $category_desc_inputs_string .= '<br>' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . tep_draw_textarea_field('categories_description[' . $languages[$i]['id'] . ']', '', 20, 5, tep_get_category_description($cInfo->categories_id, $languages[$i]['id']));

 

Can any one help me to fix this issue?

 

Thankyou.

Posted

Hi Sumear,

 

By the sounds of it you have not fully installed the contribution. The fourth part of the install required you to insert the function that is missing - tep_get_category_description.

 

HTH

 

Philip

Posted

Step was done correclty, pasted the code on the bottom before the ?>. just to test i pasted it in the middle of the file and the same error appeared.

 

This is the code that needs to be in that file:

 

  function tep_get_category_description($category_id, $language_id) {
$category_query = tep_db_query("select categories_description from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . $category_id . "' and language_id = '" . $language_id . "'");
$category = tep_db_fetch_array($category_query);
return $category['categories_description'];
 }

Posted
Step was done correclty, pasted the code on the bottom before the ?>. just to test i pasted it in the middle of the file and the same error appeared.

 

This is the code that needs to be in that file:

 

  function tep_get_category_description($category_id, $language_id) {
$category_query = tep_db_query("select categories_description from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . $category_id . "' and language_id = '" . $language_id . "'");
$category = tep_db_fetch_array($category_query);
return $category['categories_description'];
 }

 

I had a typo in my path - I missed the admin directory. You did add it to

 

admin/includes/functions/general.php

 

too, correct?

Contributions

 

Discount Coupon Codes

Donations

Posted

i fixed it just before you replied.... i started thinking. did the author meant the other file in admin? i tired and it work :P So that should be changed. its admin/includes no catalog/includes :D

 

Thanks.

Archived

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

×
×
  • Create New...