Click to See Complete Forum and Search --> : A little code from one of you nice people please


butoy
12-09-2008, 08:52 AM
Hello all.
I know this will be a 'piece of cake' to many of you but I am lost so can someone please help me with a little extra bit of code for my "Buy Now" button please. I am using "Shopping Cart HTML" code because it is the closest to what I need and it's free.

The code on the button I have at this minute is as follows:

<input name=addbox type=button value="Buy Me Now" onclick=Loc_additem('Tops_500','100.00','Tops-Code-500','tops.htm') style="font-family: Arial; font-size: 12pt; font-weight: bold">

Currently this shows in cart thus "Tops-Code-500" but I would like it to be "Tops-Code-500-Yellow" or whatever the chosen color is.

What I want to do is put a "Color Choice" drop down box, so I need to add a bit more code to make the 'color' go to the cart area as well as the item details. I have named the drop box "col_1".

Thanks in advance to everyone

Dave

Fang
12-09-2008, 09:27 AM
Loc_additem('Tops_500','100.00','Tops-Code-500-'+document.forms[0].col_1.value,'tops.htm')

butoy
12-09-2008, 09:45 PM
Thanks for the code Fang.
I have it working somewhat but it is not quite doing what I need it to do OR I have put it in the wrong place. Maybe I did not explain it correctly the first time so I will try again.
What it does now is place a Blue shirt in the shopping cart. If I go back to that same item and buy a Red shirt the same it shows as 2 red shirts in the shopping cart but NO BLue.
So my questions I guess are:
1. Should I put that code somewhere for EACH individual color in the color drop down box?
2. And if yes, is there a slightly different piece of code that goes on the 'buy now' button.
I really appreciate your help. I am a 'white boy' who lives in the Philippines and donate all my time to 'trying' to help the locals by offering to help them with stuff I only know a little bit about....hehehehe so any of you who can help me I will really appreciate it. This is the final step to completing this little online shop for a local family.
Thanks very much
Dave

Fang
12-10-2008, 03:23 AM
I assume Loc_additem adds a new item to the basket, so it should work correctly.