kevin1983
asked on
Send Item code value variant on website form
Hi
I have the following form code on a webpage below to allow a customer to select a product quantity and product variant from a website shop. What I would like to be able to do is send a different value to the shopping basket depending on what product variant the customer selects if possible?.
So for example if the customer selects “Standard head” the value passed to the shopping cart would be: “2390MSA” but if the customer instead selects: “Compact head” then the value passed to the shopping cart would be: “2390BBB”
Any help on this would be brilliant.
<form action=http://www.companywebsite.com/shop/addtocart.php method=get>
Price £1.99<span class="style1">_______</sp an>Quantit y
<select name=quantity><option>1<op tion>2<opt ion>3<opti on>4<optio n>5<option >6<option> 7<option>8 <option>9< option>10< /select>&n bsp;Varian t
<select name=type><option>Standard Head<option>Compact Head</select>
<input type=submit value='Add to Basket'>
<input name="product" type="hidden" value="2390MSA"/>
</form>
The addtocart.php page code is below which sends the information to the romancart shopping cart software:
<iframe src="http://www.romancart.com/cart.asp?storeid=12345&itemcode=<?php echo $_GET['product']?>&quantit y=<?php echo $_GET['quantity']?>&itemna me2=<?php echo $_GET['type']?>" height="400" width="600" frameborder="0" scrolling="Yes"> IFrame. </iframe>
</h2>
<p> </p>
I have the following form code on a webpage below to allow a customer to select a product quantity and product variant from a website shop. What I would like to be able to do is send a different value to the shopping basket depending on what product variant the customer selects if possible?.
So for example if the customer selects “Standard head” the value passed to the shopping cart would be: “2390MSA” but if the customer instead selects: “Compact head” then the value passed to the shopping cart would be: “2390BBB”
Any help on this would be brilliant.
<form action=http://www.companywebsite.com/shop/addtocart.php method=get>
Price £1.99<span class="style1">_______</sp
<select name=quantity><option>1<op
<select name=type><option>Standard
<input type=submit value='Add to Basket'>
<input name="product" type="hidden" value="2390MSA"/>
</form>
The addtocart.php page code is below which sends the information to the romancart shopping cart software:
<iframe src="http://www.romancart.com/cart.asp?storeid=12345&itemcode=<?php echo $_GET['product']?>&quantit
</h2>
<p> </p>
<select name="type"><option value="2390MSA">Standard Head<option value="2390BBB">Compact Head</select>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ok i tired that but i get this error message when adding either item to the cart:
"XError: 2390MSA is not a valid itemname2 value."
"XError: 2390MSA is not a valid itemname2 value."
ASKER
maybe the addtocart.php page needs to be modified also: (which includes the name "itemname2")
<iframe src="http://www.romancart.com/cart.asp?storeid=12345&itemcode=<?php echo $_GET['product']?>&quantit y=<?php echo $_GET['quantity']?>&itemna me2=<?php echo $_GET['type']?>" height="400" width="600" frameborder="0" scrolling="Yes"> IFrame. </iframe>
</h2>
<p> </p>
<iframe src="http://www.romancart.com/cart.asp?storeid=12345&itemcode=<?php echo $_GET['product']?>&quantit
</h2>
<p> </p>
ASKER
is this the correct code you think i need?:
<form action=http://www.companywebsite.com/shop/addtocart.php method=get>
Price £1.99<span class="style1">_______</sp an>Quantit y
<select name=quantity><option>1<op tion>2<opt ion>3<opti on>4<optio n>5<option >6<option> 7<option>8 <option>9< option>10< /select>&n bsp;Varian t
<select name="type">
<option value="2390MSA">Standard Head</option>
<option value="2390BBB">Compact Head</option>
</select><input type=submit value='Add to Basket'>
<input name="product" type="hidden" value="2390MSA"/>
</form>
<form action=http://www.companywebsite.com/shop/addtocart.php method=get>
Price £1.99<span class="style1">_______</sp
<select name=quantity><option>1<op
<select name="type">
<option value="2390MSA">Standard Head</option>
<option value="2390BBB">Compact Head</option>
</select><input type=submit value='Add to Basket'>
<input name="product" type="hidden" value="2390MSA"/>
</form>
ASKER
Ok ive got it working now, thanks for your help