Jump to content



Latest News: (loading..)

- - - - -

How to remove a category name from Category Box ?

category

  • Please log in to reply
16 replies to this topic

#1   Hamza101

Hamza101
  • Members
  • 5 posts
  • Real Name:Hamza Warraich

Posted 02 December 2011 - 10:04 AM

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 .

#2   Hamza101

Hamza101
  • Members
  • 5 posts
  • Real Name:Hamza Warraich

Posted 02 December 2011 - 03:46 PM

Can someone plz help thanks

#3   kymation

kymation

    Believers

  • Community Sponsor
  • 6,698 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 02 December 2011 - 07:01 PM

There are several Addons that hide categories. Check the Addons area for your version of osCommerce.

Regards
Jim
My Addons

Banners Box 2.3.x  Support
Categories Accordion Box 2.3.x  Support
Categories Images Box 2.2x  2.3.x  Support
Closest Shipper 2.2x  Support
Document Manager 2.2x  Support
Generic Box 2.3.x  Support
Get 1 Free 2.2x  Support
jQuery Banner Rotator 2.2x  2.3.x  Support
Modular Front Page 2.3.x  Support
Modular SEO Header Tags 2.3.x  Support
MVS 2.2x  Support
PDF Datasheet 2.3.x  Support
Price Updater 2.2x
Products Specifications 2.2x  2.3.x  Development Version  Support  Bugs/Suggestions
Request a Review 2.2x - 2.3.x  Support
Similar Products Box 2.2x
Specials Image Overlay 2.3x Support
Theme Switcher 2.3.x  Support

#4   motohansa

motohansa
  • Members
  • 5 posts
  • Real Name:Lucas
  • Gender:Male
  • Location:Victoria, Australia

Posted 05 December 2011 - 02:21 PM

Hi,
I am running Oscom 2.3.1.

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

View PostHamza101, on 02 December 2011 - 10:04 AM, said:

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

#5   motohansa

motohansa
  • Members
  • 5 posts
  • Real Name:Lucas
  • Gender:Male
  • Location:Victoria, Australia

Posted 05 December 2011 - 03:31 PM

Sorry I'm new, didnt realise this was General Support for v3.X until it was too late.

I have asked a team member to move this to General Support for v2.x for me.

Sorry.

#6   puddlec

puddlec
  • Members
  • 132 posts
  • Real Name:Craig
  • Gender:Male
  • Location:UK

Posted 05 December 2011 - 03:31 PM

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

#7   motohansa

motohansa
  • Members
  • 5 posts
  • Real Name:Lucas
  • Gender:Male
  • Location:Victoria, Australia

Posted 05 December 2011 - 04:41 PM

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

#8   motohansa

motohansa
  • Members
  • 5 posts
  • Real Name:Lucas
  • Gender:Male
  • Location:Victoria, Australia

Posted 05 December 2011 - 05:34 PM

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.

Edited by motohansa, 05 December 2011 - 05:36 PM.


#9   motohansa

motohansa
  • Members
  • 5 posts
  • Real Name:Lucas
  • Gender:Male
  • Location:Victoria, Australia

Posted 06 December 2011 - 06:08 AM

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

#10   kiran046

kiran046
  • Members
  • 6 posts
  • Real Name:kiran
  • Gender:Male

Posted 16 June 2012 - 08:18 AM

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

#11   multimixer

multimixer

    Lemons or Melons ?

  • Partner
  • 4,401 posts
  • Real Name:George Zarkadas
  • Gender:Male
  • Location:Greece

Posted 16 June 2012 - 08:23 AM

View Postkiran046, on 16 June 2012 - 08:18 AM, said:


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?

#12   kiran046

kiran046
  • Members
  • 6 posts
  • Real Name:kiran
  • Gender:Male

Posted 16 June 2012 - 09:28 AM

exactly the same i send before..just the ID's are different..

#13   kiran046

kiran046
  • Members
  • 6 posts
  • Real Name:kiran
  • Gender:Male

Posted 16 June 2012 - 09:39 AM

View Postkiran046, on 16 June 2012 - 09:28 AM, said:

exactly the same i send before..just the ID's are different..
and also one thing is it necessary to use the addon for the same problem....

#14   kiran046

kiran046
  • Members
  • 6 posts
  • Real Name:kiran
  • Gender:Male

Posted 16 June 2012 - 09:40 AM

View Postmultimixer, on 16 June 2012 - 08:23 AM, said:

How is your if statement exactly?
exactly the same i send before..just the ID's are different..

#15   multimixer

multimixer

    Lemons or Melons ?

  • Partner
  • 4,401 posts
  • Real Name:George Zarkadas
  • Gender:Male
  • Location:Greece

Posted 16 June 2012 - 10:30 AM

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

#16   kiran046

kiran046
  • Members
  • 6 posts
  • Real Name:kiran
  • Gender:Male

Posted 16 June 2012 - 10:42 AM

View Postmultimixer, on 16 June 2012 - 10:30 AM, said:

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

#17   kiran046

kiran046
  • Members
  • 6 posts
  • Real Name:kiran
  • Gender:Male

Posted 18 June 2012 - 10:48 AM

View Postkiran046, on 16 June 2012 - 10:42 AM, said:

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