Print Page | Close Window

Unique menu for each category

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=1612
Printed Date: 22-April-2025 at 5:12pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Unique menu for each category
Posted By: caughlan
Subject: Unique menu for each category
Date Posted: 08-May-2008 at 8:19pm
Can I call for a unique header depending on the category#?

i.e. headerA.asp if category 4, headerB.asp if category 5 etc, header.asp if not a category at all...

does anyone know the code i would use to do that?

Edit: To put it another way - can I make the left side menu unique to each main category (which will be in the horizontal nav across the top)?

for example: http://store.crabtree-evelyn.com/bath-and-body.html



Replies:
Posted By: Greg Dinger
Date Posted: 08-May-2008 at 8:26pm
I'd probably look at examining the category ID and using a IF/ELSE ASP statements to implement what you have in mind.

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

Certified ProductCart Developer

Web Design/Development/Hosting

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


Posted By: caughlan
Date Posted: 08-May-2008 at 8:28pm
That's exactly what I mean, but i don't know how to write code for it...


Posted By: caughlan
Date Posted: 09-May-2008 at 4:54pm
What about modifying the following code to give me unique menus for pre-determined categories (I hard-code my category menus):

<%if session("customerType")="1" then%>
    <!--#include file="inc_WholeSaleCatMenu.inc"-->
<%else%>
    <!--#include file="inc_RetailCatMenu.inc"-->
<%end if%>

Can anyone tell me how to ask for a unique menu for my idCategories and still have the above code work for calling the wholesale menu?


Posted By: Hamish
Date Posted: 09-May-2008 at 6:28pm
We did something similar for a site - but it was part of a slightly bigger change.
We had a single product we needed to use a variation on ConfigurePrd as well as a different header.
In this case we created  a  copy of configurePrd under a different name and amended  the menu to pint to the revised code for those products. Within the amended copy of the configurePrd code we then also included a different Header file.

In this particular case we didn't use any ASP code to switch to the different version, but that would also have been a viable and workable approach.  


Posted By: caughlan
Date Posted: 09-May-2008 at 7:38pm
Thanks Hamish that might work - I could make the main navigation at the top call on unique viewCategories files which in turn point to unique header files each with its own left side navigation. phew...

It might mean creating quite a few extra files... but if no one knows how to help me write the ASP code to switch it, I might have to do that.

Stacelynn




Posted By: Hamish
Date Posted: 10-May-2008 at 5:17am
Hi Caughlan,
     We only went this route because  we wanted both the page content and the header to be different for a single category. 
I was thinking that the best place to do this is where the header.asp is called and use If/else or case BUT...  header.asp is called from many many places.

What do you want to be different in the headers?
It may well be simpler in the short term and easier to maintain in the long term if you build a version of header.asp that can take account of the categories.



Posted By: caughlan
Date Posted: 10-May-2008 at 2:20pm
Hi Hamish - You're right, that would be quite a mess if the header is called from different spots!

I just want the left menu to change based on the category you're in. Seemed like a simple idea

So in my earlier post with the code that calls the menus, I thought it could be done here with a simple call for a new menu for each idcategory that i would specify. That would have avoided touching the header.asp completely.

But I don't know how to write code so i have no idea if it would work anyway.

On another note: This forum seems to be a place where developers-for-hire lurk and jump when they sense someone might hire them. I'm surprised at the private emails I've gotten where I've been told they have the solution, but it will cost me. I participate in many forums and this one is the worst for that...

stacelynn






Posted By: ProductCart
Date Posted: 10-May-2008 at 5:30pm
We added an article to the ProductCart WIKI since other customers might find this information helpful: http://wiki.earlyimpact.com/how_to/display_different_content_category - http://wiki.earlyimpact.com/how_to/display_different_content_category

We're counting on the WIKI becoming a true encyclopedia of everything about ProductCart. We'll need everyone's contribution to make that happen! For now, it's still a work in progress.


-------------
The ProductCart Team

Home of ProductCart http://www.productcart.com" rel="nofollow - shopping cart software


Posted By: Hamish
Date Posted: 10-May-2008 at 5:49pm
Hi,
   Wow - just been overtaken by event's then - Well done EA Smile.

Anyway - For your specific circumstances - I'm sure the code is straight forward, but probably I would use a case statement.  Firstly, what are you trying to achieve with the different menus?  It seems an unusual thing to do as usually it's best to leave the customer with the same menu so they feel they can find their way easily so I'd like to understand so I can give the right advice. 
It MAY be that the dynamic menus available from the WIKI
http://wiki.earlyimpact.com/how_to/add_category_navigation - http://wiki.earlyimpact.com/how_to/add_category_navigation
will meet your needs - but I suspect it may not.



Posted By: caughlan
Date Posted: 10-May-2008 at 7:12pm
its a pretty common in this industry to do navigation this way. The top horizontal nav stays the same, but the left navigation is specific to your category.

http://www.bathandbodyworks.com/category/index.jsp?categoryId=2484525
http://store.crabtree-evelyn.com/bath-and-body.html


Posted By: caughlan
Date Posted: 10-May-2008 at 8:42pm
<%if session("customerType")="1" then%>
    <!--#include file="inc_WholeSaleCatMenu.inc"-->
<%else%>
    <!--#include file="inc_RetailCatMenu.inc"-->
<%end if%>

 <% if pIdCategory=100 then %>
Show special content to be displayed when category 100 is shown
<% else %>
Show something else
<% end if %>

I'm going to play around with these statements and see if I can get what I'm looking for. I don't want to lose a unique menu for my wholesalers, but i hope that's easy to avoid...

thx


Posted By: Hamish
Date Posted: 13-May-2008 at 6:35am
Hi Cauglan,  if you have quite a few categories you could try something like :-

<%select case pIdCategory%>
  <%case 1 %>
     <!--#include file="inc_Menu1.inc"-->
  <%case 2 %>
     <!--#include file="inc_Menu2.inc"-->
  <%case 3 %>
     <!--#include file="inc_Menu3.inc"-->
   <%case else %>
     <!--#include file="inc_MenuAll.inc"-->
<% end select  %>



Posted By: caughlan
Date Posted: 13-May-2008 at 3:49pm
Thanks Hamish -  what exactly would I write where you've written "select case" and "case 1" etc.

I assume I'm to change something there, but my biggest stumbling block is the exact language asp uses. I just finished figuring out php and ruby for two of my other sites, and my brain is on overload - any hand-holding would be greatly appreciated!

stacelynn




Posted By: Hamish
Date Posted: 13-May-2008 at 5:40pm
Hi,  Hug - consider hands held. ASP stands for Active Server Page.  It's a microsoft term for pages built dynamically at the server.  Several languages could be used, but product cart is written in vbscript.
If you have php  & ruby under your belt then vbscript will be stright forward I would think - once your brain's recovered a bit Big%20smile.

To find out more  about vbscript then  visit http://www.w3schools.com/Vbscript/default.asp - http://www.w3schools.com/Vbscript/default.asp
It's a traditional procedural language & to distinguish it from the HTML etc it's encapsulated in <%  %>  - Not necessarily, in fact preferably not, around each individual line.

There's also SQL & Javascript in the files as well.


Posted By: Hamish
Date Posted: 13-May-2008 at 5:42pm
The "select case" statement gives the name of a variable and then each "Case" test checks the value of that variable until a match is found and then executes that piece of code. If no match is found then, if present, "case else" is executed. 



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