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 &pound;1.99<span class="style1">_______</span>Quantity&nbsp;
<select name=quantity><option>1<option>2<option>3<option>4<option>5<option>6<option>7<option>8<option>9<option>10</select>&nbsp;Variant&nbsp;
<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']?>&quantity=<?php echo $_GET['quantity']?>&itemname2=<?php echo $_GET['type']?>" height="400" width="600" frameborder="0" scrolling="Yes"> IFrame. </iframe>
            </h2>
             <p>&nbsp;</p>
kevin1983Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MMDeveloperCommented:
<select name="type"><option value="2390MSA">Standard Head<option value="2390BBB">Compact Head</select>
0
MMDeveloperCommented:
Sorry I forgot the closing option tags

<select name="type">
      <option value="2390MSA">Standard Head</option>
      <option value="2390BBB">Compact Head</option>
</select>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kevin1983Author Commented:
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."
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

kevin1983Author Commented:
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']?>&quantity=<?php echo $_GET['quantity']?>&itemname2=<?php echo $_GET['type']?>" height="400" width="600" frameborder="0" scrolling="Yes"> IFrame. </iframe>
            </h2>
             <p>&nbsp;</p>
0
kevin1983Author Commented:
is this the correct code you think i need?:
<form action=http://www.companywebsite.com/shop/addtocart.php method=get>
Price &pound;1.99<span class="style1">_______</span>Quantity&nbsp;
<select name=quantity><option>1<option>2<option>3<option>4<option>5<option>6<option>7<option>8<option>9<option>10</select>&nbsp;Variant&nbsp;
<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>
0
kevin1983Author Commented:
Ok ive got it working now, thanks for your help
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.