Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] CategoryBoxEnhancement_v1.0 for 2.2 MS2


Nils P.

Recommended Posts

Hi all,

 

this is my first contribution. It's small, but I like it and I believe it's useful, and it's my first "thank you" to the osC community.

 

What it does can be seen on this screenshot:

http://www.leer.privat.t-online.de/pics/CatBoxEnh.gif

 

 

Taken from my readme:

 

This contribution is supposed to improve the look and feel of the categories box, improve navigation and help users to keep their bearings on the site.

 

1. It will add a small image as "bullet" to the left of every category in the category box. There are two different images, one for categories that have subcategories, one for those that don't.

 

2. It will get rid of the funny-looking ASCII-arrow ( -> ) that used to indicate categories containing subcategories.

 

3. It will highlight the current category in the box. User will have an easier time telling where they are on the site.

 

Oh, here it is:

http://www.oscommerce.com/community/contributions,1480

 

Questions, comments, suggestions, critizism, welcome in this thread.

 

Greetings,

Nils

Link to comment
Share on other sites

  • Replies 97
  • Created
  • Last Reply

Top Posters In This Topic

I've just uploaded a new version of my contribution Category Box Enhancement 1.1.

 

http://www.oscommerce.com/community/contributions,1480

 

Here's what's new:

 

- Arrows/bullets are now clickable

 

- Colored highlighting of current category will now work if a product is not selected via categories, but via 'specials', 'What's new', 'Bestsellers' etc.

 

- Slightly changed arrow images

 

- Added readme file in German

 

 

I recommend using this new version. Thanks to all who mailed me with feedback.

If you do upgrade, make sure you follow the instructions in the readme file (i.e. don't forget to overwrite the existing arrow images! :wink: )

 

Nils

 

Questions, comments, suggestions, critizism, is still welcome in this thread.

Link to comment
Share on other sites

hehe Hi guys

 

Im totally new to osCommerce .. I just came across few days ago and I fell in love with this awsome software.. I used to be sysop back in the BBS days use to run WWIV and it was kind of like this.. meaning bunch of people get together and hack the code.. I Love it..

 

Thanks all the people who contribute to this project....

 

Anyways I finally installed my first modification Category Box Enhancement 1.1. It works as promised ..Thank u Nils P... For a newbee this was pretty easy.

 

I have just one question Mam/Sir .. How do you change the collor.. From red I want to go to dark blue. I've looked but I couldnt understand were it was.. Any help would be greatly apreciated.

 

Nice to meat all you who help this fine project. God Speed :D And Much Thanks again. Im a beliver in open source, this just came a another reason.

Link to comment
Share on other sites

I have just one question Mam/Sir .. How do you change the collor.. From red I want to go to dark blue. I've looked but I couldnt understand were it was..

Um... Sir, in my case :wink: ...

OK, here's how to change the highlighting color:

open file catalog/stylesheet.css, search for this entry:

SPAN.errorText {

 font-family: Verdana, Arial, sans-serif;

 color: #ff0000;

}

and change the color value to a blue color, like for instance

  color: #223399;

...or to any other color you wish to. Thats all...

 

Nils

Link to comment
Share on other sites

Thanks everybody, but remember I'm still a n00b at this :wink:

 

And that's why...(drumroll)... my contrib needs a hotfix:

In case a shop has caching activated (which they should, AFAIK), the highlighting of the current category won't work. It seems nobody noticed this, which is good. Hm- maybe it's not. Anyway, do this:

 

open file catalog/includes/functions/cache.php

search for function tep_cache_categories_box

add this to the function's globals: $cat_name

 

so that the first two lines of the function will look like this:

    function tep_cache_categories_box($auto_expire = false, $refresh = false) {

   global $cPath, $language, $languages_id, $tree, $cPath_array, $categories_string, $cat_name;

That should do the trick. You might have to empty the chache directory though to see an effect. This fix will be integrated into the next version of this contribution. Yes, I know I sound like Micro$oft now. Until then, I'll add it to the contrib download section anyway.

 

I'll be back...

Nils

Link to comment
Share on other sites

I made some small changes to make this beautifull contribution work together with the BTS ( http://www.oscommerce.com/community/contributions,1263 ).

 

I added it to the CBE contribution, I hope that is ok. Please tell me if I'm wrong it's my first upload. :?:

 

Thanks Nils, for the contribution and the support! 8)

Link to comment
Share on other sites

I added it to the CBE contribution, I hope that is ok.

Sure it is, that's the way it's supposed to be! I don't have the BTS contribution installed nor do I know much about it, but actually I was thinking about adding some packages that will make my contrib work with major existing contributions myself (in cases where it doesn't already do that). Stuff like "Show all products" etc.

 

So, thanks for your addition,

 

Nils

Link to comment
Share on other sites

  • 2 weeks later...
Is it possible to limit the number of sub-categories appearing in the category box?  Appreciate any advise.

 

Do you mean the number of sub-category levels in the category tree or the total number of sub-categorie that one parent-category can have?

 

Nils

Link to comment
Share on other sites

Yes, actually I think I know how to do that. I don't think it would fit with my contribution very well though, as part of the idea is to always let customers know where they are on the site by highlighting the current category in the box, and if that category name isn't there, I believe it can lead to a lot of confusion.

 

Anyways, here's what you do:

 

In categories.php, find this:

global $tree, $categories_string, $cPath_array, $cat_name; (about line 20)

 

and add this right beneath it:

if ($tree[$counter]['level']<3)

{

Then find this: $categories_string .= '<br>'; (about line 65)

...and simply add this right beneath it:

}

 

...that should only display three level of categories. You could change that number by replacing the "<3" with any other number, e.g. 1 will only display top level categories. Did I mention I don't really like it? :wink:

 

Nils

Link to comment
Share on other sites

Great contrib have had it going on other site no problem, but I am having a small problem here, hope you can help.

 

I have the Category Box Enhancement v1.1, but I have also had to include the Graphical Infoboxes Contrib which has required a lot of categories.php changes, this was to get both working together.

 

What seems to be happening is the the sub-cats all appear at the base of the box?

Testing

I have no clue to sort this out, as my knowledge of osc and php is but a few days old.

Thx in advance.

Link to comment
Share on other sites

j0ker,

Graphical Infoboxes is a MS1 contribution as far as I know, and your shop is MS1 too isn't it. What you'd need to get Category Box Enhancement (which is for MS2) working is a rewrite of your categories.php that will fit your shop. It's more than just changing a line here and there, sorry I have no better news.

Nils

Link to comment
Share on other sites

OK Elwyn, I just looked at that contrib, at least the categories.php (dated 2002/11/12) is still for a version prior to MS2, maybe 2.2 CVS2. So either your shop version is older than you think it is, or someone rewrote your Graphical Inforboxes contribution to match MS2.

Anyway it's as I said, you need a rewrite of your own categories.php if you want both contribs working with each other.

 

Nils

Link to comment
Share on other sites

Nils I have also just checked the cat.php and I also confirm that it is what you said, excuse my ignorance I am very new to osc and php.

/*

$Id: categories.php,v 1.23 2002/11/12 14:09:30 dgw_ Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2002 osCommerce

 

Released under the GNU General Public License

*/

Thx for your help, but is there no solution to this problem.

Link to comment
Share on other sites

  • 1 month later...

Hi, I installed the Catagory Box Enhancment Contrib from Sir Nils to the older version of OSC and all is working great...Good on the Germans :)

 

But I would appreciate some ideas on how to accomplish this:

 

I would like to change the font of the Top Catagories (ie the catagories with the solid arrow) to 12 point font.

 

And keep the Sub Catagories (ie the catagories with the light arrow) at 10 point font.

 

I don't think that these catagories fonts are in stylesheet I treid to change some and I made changes to other info boxes but not catagories. I would probably have to add a code? Could someone help me with what to add and where to add if it is not very difficult!?

 

Thanks a bunch, Alyss

Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...