Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to remove a category name from Category Box ?


Hamza101

Recommended Posts

Hi

I want to remove a category name from the category box on my website, but i just want to remove the name, i dont want to delete the category from admin panel. I want to keep the category just dont want it to show up in categories. Some help would be really appreciated thanks .

Link to comment
Share on other sites

Hi,

I am running Oscom 2.3.1.

 

I am also looking for something to 'Hide' categories.

I want to remove a category name from the category box on my website, but i just want to remove the name, i dont want to delete the category from admin panel. I want to keep the category just dont want it to show up in categories.

 

As Jim suggested I went and looked through the Addons and found a number of different solutions but none of them were quite what I was after.

 

I found Hide Categories & Products V1 .. http://addons.oscommerce.com/info/5907

This hides it completely from all parts of the store.

 

My idea was to do similar to this addon where there is another column inserted into the categories table, categories_status, in the database but instead of completely hiding it in the store using the IF statement in the categories.php. Instead try and create a conditional statement in the bm_categories.php so that it only displays the categories with 'category_status = Active or 1' in the categories box but leaves all the categories in the admin and as filters in the manufactures.

 

I'm just new to sql and php so if possible I need help writting the conditional statement for the category box display.

 

If someone could point me in the right direction and/or help with the syntax so I can have a go at writing something myself it would be really appreciated.

 

If I get it working I would like to post it back as another contribution (giving appropriate credit).

 

Regards

Lucas

Link to comment
Share on other sites

this is how i have removed some categorys from my categories box on one of my websites

// do not show the following categorys
if (($tree[$counter]['path'] != 58) && ($tree[$counter]['path'] != 108) && ($tree[$counter]['path'] != 123)) {
$categories_string .= '<a href="';

then you just need to close the if statement

$categories_string .= '</a>';
// close do not shoe categorys
}

 

the only thing that needs to be changed is the number (58, 108, 123),

 

i am using a slightly different categorys box than what osc 2.3.1 comes with (but should still work

Phoenix support now at https://phoenixcart.org/forum/
App created for phoenix
TinyMCE editor for admin

 

Link to comment
Share on other sites

Hi Craig,

 

Thanks alot for the fast reply.

 

I have tried putting the code into bm_categories.php but I'm struggling to find the right place to put it.

 

Can you give me an indication of where it should go please.

 

Thanks

Link to comment
Share on other sites

Craig,

 

your a legend. worked perfectly. I forgot to mention that I also have a contribution called Unsortedlist_categoryinfobox installed.

But I managed to play further and get it all working.

 

I am now going to work on setting up a column in the database which is refered to by the IF statement so that the hidden category doesnt need to be hard coded.

 

I'll post back if I manage to get it working incase anyone is interested.

 

Thanks again Craig.

Link to comment
Share on other sites

I have finally managed to work out how to hide categories from the Categories info box ONLY and leave the categories in the Admin (with active/inactive control) and as filters under manufacturers.

( I have been looking and trying to do this for months, sorry if this has already been solved somewhere else but I searched and searched and couldnt find how to get this specific setup until now)

 

I was trying to do complicated things and build something myself but it turns out partial installation of an already exisiting addon was all that was required.

 

Use this Addon: http://addons.oscommerce.com/info/5907

 

Then follow the installation instructions given carefully. (I have got this to work in v2.3.1)

Note: For those doing this in v2.3 the file: catalog/includes/boxes/categories.php can be found here: catalog/includes/modules/boxes/bm_categories.php

 

Skip ONLY instructions relating to modifying the following files:

 

catalog/index.php

&

catalog/includes/boxes/dm_categories.php

 

And thats it.

 

As I mentioned, this sets up the Active/Inactive in the admin and sets up the new column in the database and then hides the category only from the category info box.

 

Thanks very much to Craig for the initial help and Spooks for the great contribution.

 

Cheers

Lucas

Link to comment
Share on other sites

  • 6 months later...

I am suffering from the same problem.. but its not working for me.. please tell me exactly where to put this code,

 

// do not show the following categorys

if (($tree[$counter]['path'] != 58) && ($tree[$counter]['path'] != 108) && ($tree[$counter]['path'] != 123)) {

$categories_string .= '<a href="';

 

$categories_string .= '</a>';

// close do not shoe categorys

}

 

i inserted it in bm_catagory.php but it hides all catagories except the one which i want to hide.... and is it necessary to use the addon with this code.. please reply. thank you

Link to comment
Share on other sites

 

if (($tree[$counter]['path'] != 58) && ($tree[$counter]['path'] != 108) && ($tree[$counter]['path'] != 123)) {

 

i inserted it in bm_catagory.php but it hides all catagories except the one which i want to hide....

 

How is your if statement exactly?

Link to comment
Share on other sites

I would suggest you post your statement, paste it to here

 

// do not show the following categorys

if (($tree[$counter]['path'] != 46)) {

$categories_string .= '<a href="';

$categories_string .= '</a>';

// close do not shoe categorys

}

 

i want to hide the catagory whose id is 46....

Link to comment
Share on other sites

// do not show the following categorys

if (($tree[$counter]['path'] != 46)) {

$categories_string .= '<a href="';

$categories_string .= '</a>';

// close do not shoe categorys

}

 

i want to hide the catagory whose id is 46....

problem solved.. i use the hide catagory and products module for this... thank you..
Link to comment
Share on other sites

Archived

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

×
×
  • Create New...