/    Sign up×
Community /Pin to ProfileBookmark

A little code from one of you nice people please

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

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@FangDec 09.2008 — Loc_additem('Tops_500','100.00','Tops-Code-500-'+document.forms[0].col_1.value,'tops.htm')
Copy linkTweet thisAlerts:
@butoyauthorDec 10.2008 — 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
Copy linkTweet thisAlerts:
@FangDec 10.2008 — I assume Loc_additem adds a new item to the basket, so it should work correctly.
×

Success!

Help @butoy spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...