Forum Moderators: buckworks

Message Too Old, No Replies

Dynamically generate PayPal forms?

... or should I get a cheap shopping cart?

         

MichaelBluejay

3:52 am on Sep 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



PayPal's shopping cart system seems to require a separate <FORM> for every single product on the page. I'd rather not clutter up and bog down my page with a gazillion forms, so I thought maybe I could dynamically generate a form on the fly with JavaScript when the user clicks on Add to Cart link. My only real idea is to do a window.open() to open a new window, write out the form with document.write, auto-submit it, and then do a window.close(). But that seems kind of cumbersome, and I doubt my visitors will appreciate windows popping up and closing themselves all over the screen. Is there a better way to do this?

Alternatively, I wouldn't mind spending up to $100 on a shopping cart system that works with PayPal (as long as it doesn't require a separate <FORM> for each product), if anyone has any recommendations.

Thanks! -MBJ-

jatar_k

4:34 am on Sep 19, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



dont they have an API so you can load up the shopping cart as much as you like and then just send the single payment on checkout?

jim_w

6:00 am on Sep 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The biggest problem I have with PayPal is having to put my email address in the HTML file so harvesters can find it. They said I could use a number, but when they told me where the number was, and I found it and used it, it said it wasn't a valid PayPal cart. If I put the email addy back in, it works fine. So in your decision, you may want to consider this.

ectect

9:00 am on Sep 19, 2003 (gmt 0)

10+ Year Member



Hi

Have you looked at the 3rd party developers pages at Paypal they have a number of carts available at under $100

Cheers

apsunick

12:55 pm on Sep 19, 2003 (gmt 0)

10+ Year Member



Check out [hotscripts.com...]

PCInk

3:38 pm on Sep 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Just create one blank form on your page, with all the input boxes hidden. In a Javascript function, write the values into the form text boxes and then form.submit();

It does require the user to have JS enabled - you may lose orders otherwise.

MichaelBluejay

5:10 am on Sep 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thanks, PCInk, that's exactly the kind of solution I'm looking for. It was pretty easy to code it, too.

I'm not too worried about losing sales to those who don't have JavaScript enabled. I'd rather that my pages load three times faster for the 95% of users who do.

Thanks again, -MBJ-