Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question on design of shopping cart

Status
Not open for further replies.

dipita

Programmer
Apr 7, 2005
22
US
Hi,
I have the need to use a shopping cart solution that handles the following scenario: A user is initially given a choice of products a, b,c. After he/she chooses a, he/she will be given a choice of d, f but not e. SO basically at some level of the hierarchy I need to control what is displayed to choose from - do you know how this can be done if you're using packaged shopping cart solutions like zencart? Or has anyone used some solution that will solve this problem?
I would rather not write the whole thing (don't have the time.)
Thanks!
 
dipita, what programming language are you using?? What database??

What I would do is have a main table in the dB that acts as a hierarcal tree, kinda like:
COLUMN1 COLUMN2 COLUMN3
a d,e linka
b f,g,h linkb
c i,j,k,l linkc

I use Coldfusion as my language so if I had to code that, I would do:
Code:
<cfif column1 eq "a">
  <table><tr><td><a href="linka">#column2#</a></td></tr></table>
<cfelseif column1 eq "b">
  <table><tr><td><a href="linkb">#column2#</a></td></tr></table>
<cfelse>
  <table><tr><td><a href="linkc">#column2#</a></td></tr></table>
</cfif>

What that does is if the user selected 'a' then the choices from COLUMN2 would show. If the user selected 'b' then the choices from COLUMN2 would show...etc

Do a google search on shopping carts and see what comes up.

[sub]
____________________________________
Just Imagine.
[sub]
 
HI GUJUm0del,
ok I see what you're saying but here we're assuming two things;
1. there are 2 tables (one for each level of hierarchy ) - do generic packages support this?
2. you'll need one more table to get details of the products (since this table would only show the hierarchical relationship..) Unfortunately, I haven't been able to sucessfully install an open source product like zencart to figure out what their table structures are like and what flexibility there is for customization of databases. Have you used x-cart - that's supposed to be the other solution out there that's good?
Thanks,
 
I used the Ben Forta shopping cart that came in his CF book. That pretty much had the sections divided. You can see how I used it here:
I don't know what generic packages support, but if you know the programming language that was used to colde the car then you can always tweak it. That is what I did with the Ben Forta's shopping cart.

What dB are you using?? What programming language??

[sub]
____________________________________
Just Imagine.
[sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top