Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add PayPal cart

Status
Not open for further replies.

zdvdla

Technical User
Apr 28, 2007
18
US
I built a site using flash and the client now wants me to add a shopping cart.
The instructions seem fairly straight forward but I dont know how to apply it to this site PayPal gives you the code, says to paste in into your page. Should I be using DW to do this? The code is HTML but Im not sure where to paste it.
I have a scrolling tile list that is programmed to listen for a CLICK and display a larger picture of the item and a brief description of it.
I am thinking that I can pull the name from the SOURCE clicked in the tile list and have a handler place the correct btn on the page.
I haven't come across anything on the web that tells me how to place HTML directly into a flash doc.
I could just export the swf and bring it into DW, but I really want to know that I did this all in Flash.
Any ideas?
Thanks...
 

can you give me any more details on how?
 
PayPal "Add to Cart" HTML looks like this:
Code:
<form target="paypal" action="[URL unfurl="true"]https://www.paypal.com/cgi-bin/webscr"[/URL] method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="name@yourbusiness.com">
...
In Flash terms, this would be translated into something like:
Code:
LoadVarsInstance["cmd"] = "_cart";
LoadVarsInstance["business"] = "name@yourbusiness.com";
...
LoadVarsInstance.send("[URL unfurl="true"]https://www.paypal.com/cgi-bin/webscr",[/URL] "_blank", "POST");

Kenneth Kawamoto
 

ok..I get some of it...how do you link that to the button?
Or do you do that separately with another var?
Would I need to have separate code for each btn?
Why the brackets?
LoadVarsInstance["business"]
set up for an array?

thanks Ken..I know this is alot...
 
On button click create a LoadVars instance, populate with variables, then send them to PayPal.

Each item you selling needs different set of variables (such as product name, price, etc.) You can create a button for each item, or one button with radio button/dropdown menu to select an item - it's up to you.

[tt]LoadVarsInstance["business"][/tt]

... is same as ...

[tt]LoadVarsInstance.business[/tt]

basically creating a property in the LoadVars instance dynamically.

Go to PayPal and read developer's guide. You'll need to know what you're doing...!

Kenneth Kawamoto
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top