Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

c path and sub directories


detoner

Recommended Posts

Hi

Can anybody help me - I am using this code - in the includes/function/general.php file to add a category description to each category listing but

 

// Return category description by +++++frofi+++++

$description_string = sprintf('Nothing here');

function tep_cat_description() {

if ($_GET[cPath] == "73") {

$description_string = sprintf(TEXT_CAT_KYLIE);

}

if ($_GET[cPath] == "30") {

$description_string = sprintf(TEXT_CAT_ORGANIC);

}

// Do not add anything below this line

return $description_string;

}

// End of Category description

 

a - how to you code it for subcategories - eg cPath=27&cID=60 - I have tried [cPath] == "27_60" but that didn't work

 

and secondly how does it work by manufacturers e.g. mID=16 - this is different to cPath ?

 

Thanks

Dawn

Link to comment
Share on other sites

I would do the whole thing differently

 

1) add one more field to DB table categories_description called "my_description" or anything you like

2) alter file catalog/admin/categories.php to make a text field so tha I can add the descriptions (you can add this wherever the "categories_name" is present in that file in a similar manner)

3) alter file catalog/index.php, to query for "my_description" together with categories_name

4) alter same file (index.php) to display that description in any way I like

 

For manufacturers same thing, table is manufacturers_info, and admin file is manufacturers.php (follow the entries for manufacturers_url) and similar changes in index.php

 

That's much better, so you don't have to change the function each time you add a category

Link to comment
Share on other sites

I would do the whole thing differently

 

1) add one more field to DB table categories_description called "my_description" or anything you like

2) alter file catalog/admin/categories.php to make a text field so tha I can add the descriptions (you can add this wherever the "categories_name" is present in that file in a similar manner)

3) alter file catalog/index.php, to query for "my_description" together with categories_name

4) alter same file (index.php) to display that description in any way I like

 

For manufacturers same thing, table is manufacturers_info, and admin file is manufacturers.php (follow the entries for manufacturers_url) and similar changes in index.php

 

That's much better, so you don't have to change the function each time you add a category

 

sounds like a better solution but would take me a while to figure this out

In the short term i would like to know how to add the subcategories ?- - can you answer how you call the subcategories using cPath?

Link to comment
Share on other sites

I would do the whole thing differently

 

1) add one more field to DB table categories_description called "my_description" or anything you like

2) alter file catalog/admin/categories.php to make a text field so tha I can add the descriptions (you can add this wherever the "categories_name" is present in that file in a similar manner)

3) alter file catalog/index.php, to query for "my_description" together with categories_name

4) alter same file (index.php) to display that description in any way I like

 

For manufacturers same thing, table is manufacturers_info, and admin file is manufacturers.php (follow the entries for manufacturers_url) and similar changes in index.php

 

That's much better, so you don't have to change the function each time you add a category

found this contribution which does it for category descriptions

http://addons.oscommerce.com/info/2343

anybody else looking for this function works well and adapted for 2.3.1

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...