How to remove a category name from Category Box ?
#1
Posted 02 December 2011 - 10:04 AM
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
Posted 02 December 2011 - 03:46 PM
#3
Posted 02 December 2011 - 07:01 PM
Regards
Jim
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
Posted 05 December 2011 - 02:21 PM
I am running Oscom 2.3.1.
I am also looking for something to 'Hide' categories.
Hamza101, on 02 December 2011 - 10:04 AM, said:
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
Posted 05 December 2011 - 03:31 PM
I have asked a team member to move this to General Support for v2.x for me.
Sorry.
#6
Posted 05 December 2011 - 03:31 PM
// 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
Posted 05 December 2011 - 04:41 PM
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
Posted 05 December 2011 - 05:34 PM
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
Posted 06 December 2011 - 06:08 AM
( 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
Posted 16 June 2012 - 08:18 AM
// 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
Posted 16 June 2012 - 08:23 AM
kiran046, 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
Posted 16 June 2012 - 09:28 AM
#15
Posted 16 June 2012 - 10:30 AM
#16
Posted 16 June 2012 - 10:42 AM
multimixer, on 16 June 2012 - 10:30 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....
#17
Posted 18 June 2012 - 10:48 AM
kiran046, on 16 June 2012 - 10:42 AM, said:
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....
Also tagged with one or more of these keywords: category
osCommerce Online Merchant v2.x →
Installation and Configuration →
Category Image not showing in CatalogStarted by DonStone, 04 May 2013 |
|
|
||
osCommerce Online Merchant v2.x →
General Support →
Getting the product into the correct category.Started by websitehelp, 26 Apr 2013 |
|
|
||
osCommerce Online Merchant v2.x →
Installation and Configuration →
change category images directoryStarted by dhooper, 21 Jan 2013 |
|
|
||
osCommerce Online Merchant v2.x →
General Support →
Add new category pageStarted by cpc2012, 31 Dec 2012 |
|
|
||
osCommerce Online Merchant v2.x →
Installation and Configuration →
Header/Category Page CreationStarted by cpc2012, 27 Dec 2012 |
|
|









