Print Page | Close Window

Customizing Category Menu

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Customizing ProductCart
Forum Description: Exchange messages with other users that are customizing ProductCart.
URL: https://forum.productcart.com/forum_posts.asp?TID=1446
Printed Date: 02-July-2024 at 8:26pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Customizing Category Menu
Posted By: wsiwpg
Subject: Customizing Category Menu
Date Posted: 12-March-2008 at 6:02pm
Hello,

We've recently lost our programmer, and as the remaining developer, I am trying to find out how I would approach the customization of the tree menu navigation for product categories.

First, of course, I find the +/- useless to our needs. However, since I'm no programmer, and minimally experienced in the javascript and asp side of things, I'm not sure what code I do and do not touch to remove it from the category list.

Secondly, I would like to have control over the sizing/styling of categories and subcategories. If I could have the font size smaller on subcategories, etc, that would greatly improve the look and usability of the store.

Last, and I am not convinced on this, I would like to have the option for all categories and subcategories to show without having to expand or contract. However, I'm not positive that it will be the best option in the end, so also being able to nicely style the menu WITH the expand/collapse feature is also important.

I know these changes can be made, but like I said, I haven't played with the tree menu before, so any tips on where to start would be much appreciated! Thank you!



Replies:
Posted By: Greg Dinger
Date Posted: 12-March-2008 at 6:25pm
The tool that generates the category navigation can be a bit tricky to alter.  I have done so a few times and keep refining the results.

With http://www.pestdetour.com/ - http://www.pestdetour.com , I simply needed to get the classes assigned so that the horizontal divider would seperate the categories but not the subcategories.

http://www.wranglersroost.com/store/pc - http://www.wranglersroost.com/store/pc (not yet launched) required a bit more finessing.  To accomplish this the category navigation was altered to assign different CSS classes to categories versus subcategories.

http://www.home-distilling.com/home.asp - http://www.home-distilling.com/home.asp (also not launched but very close) features a subcategory listing that is open at the beginning.  This required dual CSS class assignment as performed for Wranglers, but also involved a slight adjustment to the JS.

So while my post probably doesn't help in terms of coaching you as to how to achieve your required changes, I do try to point out that such changes are possible albeit not without a bit of effort. 


-------------
GreyBeard Design Group

Certified ProductCart Developer

Web Design/Development/Hosting

http://tinyurl.com/5c8t4t" rel="nofollow - Add-Ons & Custom Code |


Posted By: wsiwpg
Date Posted: 13-March-2008 at 10:01am
Well thank you for your reply! I do see now the possibilities that arrive when customizing the navigation, however, since I've still no idea where to start, might you be able to point me in the right direction? For example, to add your classes to the categories and subcategories, what file did you edit?


Posted By: Greg Dinger
Date Posted: 13-March-2008 at 10:08am

pcadmin/genCatNavigation.asp

Be sure to have a backup of the page if you begin to edit it. 

 



-------------
GreyBeard Design Group

Certified ProductCart Developer

Web Design/Development/Hosting

http://tinyurl.com/5c8t4t" rel="nofollow - Add-Ons & Custom Code |


Posted By: Hamish
Date Posted: 13-March-2008 at 10:14am
Hi,
  There are lots of options open to you. Personally I'm quite a fan of the dynamic navigation menus available from the support centre :
http://www.earlyimpact.com/productcart/support/developers.asp - http://www.earlyimpact.com/productcart/support/developers.as p

Mainly because we don't have to re-generate the navigation menus when updating a site. Styling is achieved with CSS and there are various options available.
If none of these suits your needs I recommend engaging someone to assist you (perhaps Greg ?? )  


Posted By: wsiwpg
Date Posted: 13-March-2008 at 10:23am
- Hamish,

Thank you for the tip! The code snippet for displaying all categories expanded is very close to what I was looking for. On one last note, is there a way to alter the code to show only the first two levels of categories? (Ie: category and only the first level subcategory)

Thank you to everyone else for your input! I will be sure to keep all your help and options in mind. :)


Posted By: Hamish
Date Posted: 13-March-2008 at 10:54am
Hi,
  I assume you mean  display_cat_subcat.zip  - file viewCategories4.asp
Please note - I haven't tested the changes below !

To remove the additional subcategories remove from Line 40 :
<% myCatStr="SELECT idCategory, categoryDesc FROM categories WHERE idparentcategory="& var_idCategory2

to lines 74-75 :
        <% rsCatObj3.moveNext
        loop %></td>

- leaving behind a
</td>

HTH





Posted By: wsiwpg
Date Posted: 13-March-2008 at 11:17am
It worked, thank you! I've had one change request from our client, and I do need to know further information on how possible it is. Sorry to have to rely so heavily on everyone's help, but at least it's a learning experience for the future!

If I were to use the Show Categories & Subcategories snippet from the developer's corner, (display_cat_subcat.zip - file viewCategories4.asp) is there a way for us to remove specific category/subcategory sections from the dynamic menu and hard code them elsewhere on the page, but still have the original menu be dynamic?

To make things clearer, our client is running a music store. They want the music categories listed on the left hand side, and the equipment on the right hand side. As the equipment will never change, the client doesn't mind if that is hard coded into the layout, however, since the music categories will be constantly changing, the client would like for the left hand side to be dynamic, so they may create those changes themselves.


Posted By: Hamish
Date Posted: 13-March-2008 at 11:44am
I've done this to remove a single category before but you can easily extend the method :-
This is customisation of the ASP code - so keep documentation of what you have done and a copy of the original file. Because this is an additional  piece of code rather that part of the base product you are fairly safe from updates over-writing your customisations, but it's best to be safe and also best practice.

Anyway -

Look for the lines in the format :-
<myCatStr="SELECT idCategory, categoryDesc FROM categories WHERE idcategory > 1 AND idparentCategory=1 ORDER BY priority, categoryDesc ASC"

You can add additional conditions to prevent certain categories being displayed.
e.g. to remove category 4 amend it to read :
 
<myCatStr="SELECT idCategory, categoryDesc FROM categories WHERE idcategory > 1 AND idCategory<>4 AND idparentCategory=1 ORDER BY priority, categoryDesc ASC"

The code in the sub-levels is similar so the same principle applies - but I suspect you will just need to amend the top level query to get what you want.

 


Posted By: Hamish
Date Posted: 13-March-2008 at 12:02pm
I just re-read your last post - Don't forget the dynamic navigation will, by it's very nature, show all the categories, negating the need for hard coded elements on the main page.
Of course, if there are other reasons for the split that is absolutely fine.

You could also split the menu using a small variation on my previous post to have separate Music and Equipment menus.
You could also filter on categoryDesc instead of idCategory if you wish.     



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net