Item by Color
Hi, I am trying to put a drop down menu underneath a golf umbrella by color so that when user selects color it auto populates the shopping cart. This is what technical support told me to do:
This will start out by creating a recordset on your product detail page. This recordset should be filtered on the product id so that only that product's info is displayed on the page.
You can add in additional recordsets to select the sizes and colors for that item as well. Once you have all of these recordsets on the page you would then add in the select lists to your add to cart form and set them dynamically to be populated from the recordsets.
The final step in this process would be to alter your cart object to ensure that it has columns for these values, once you have done that you only need to update your add to cart server behavior so that it binds the newly created select lists to their corresponding cart columns.
This is just a high level overview of the process, please post back with any specific questions that you have about any part of this and we will be glad to help you get this worked out.
I have done this. I created a separate MySQL table named "Golf" and then added recordsets by color. Here is what my code for this "Add to Cart" button looks like:
<form name="sumidrive1_15_ATC_<?php echo $row_rsGolfUmbrella["golfId"]; ?>" method="POST" action="<?php echo $_SERVER["PHP_SELF"]; ?><?php echo (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != "")?"?".$_SERVER["QUERY_STRING"]:""; ?>">
<input type="hidden" name="sumidrive1_15_ID_Add" value="<?php echo $row_rsGolfUmbrella["golfId"]; ?>" >
<input name="sumidrive1_15_Quantity_Add" type="text" class="qtyformelem" value="1" size="4" >
<option value="<?php echo $row_rsGolfBlk["golfColor"]; ?>" selected="selected">Black</option>
<option value="<?php echo $row_rsGolfNavy["golfColor"]; ?>">Navy</option>
<input name="sumidrive1_15_ATC" type="image" class="cartbutton" value="Add to Cart" src="/assets/misc images/cart.gif" alt="Add to Cart" border="0">
Currently when I add to cart, nothing is being picked up. Please help! Maybe I am filtering my recordsets incorrectly. Thanks!