Facebook MySpace Twitter Digg Delicious Stumbleupon Google Bookmarks RSS Feed 
( 0 Votes )

Dynamically Generate Paypal Buttons

In this tutorial you are going to learn how to use Dreamweaver to Dynamically Generate Paypal Buttons in ASP. This tutorial assumes you are familiar with Dreamweaver data sets and static Paypal Buttons. This is great tutorial for an online storeowner moving from static pages to a database driven site. You can use this for multiple buttons on one page or a single button on a detail page. Don't Have a Paypal account? You can signup for Free Click Here!

First off you are going to go to Paypal and create a button that is as close to what you want as you can. This gives you a really good starting point. Don’t worry; we are not going to get all of the buttons by manually entering information. Now Copy the Code and put it into a blank document so we can manipulate it to fit our needs. Now your button should look similar to this.

First lets take a look at the Paypal button. The Button is actually a form that transmits data to Paypal. Each of the little yellow boxes are called hidden fields. You not the buyer can only see these attributes. Each of these attributes contains a piece of information that is going to be sent to Paypal. Lets click on one and see what its properties are.

In the property box you should see two things the name of the hidden field and the value.

This hidden field inputs the command for Paypal to add the item to the customers cart. You should not change the names of the hidden fieldsever or Paypal won’t be able to recognize the information. Some hidden fields you will want to be consistent and have the same value for every item, add is one of these.

As you click on these hidden fields you will see the ones you will need to change such as item_name, item_number, and amount. Now we are going to bind your hidden fields to the fields in your record set. I am assuming you can already dynamically generate a product page.

1. Take your button and copy and paste it into your detail or product page where you would like it.

You can personalize your buttons appearance. You can use any button image you want. I already have one made. You can always come back and change it later. Click on the Paypal button image. Now look in the property inspector and click on the yellow folder to locate your source image. I recommend using your own image to add to a professional look to your site.

2. Next let’s edit our hidden fields. Click on the item_name hidden field. Now click on the little lightning bolt in property inspector.

And you should get a popup menu like this:

3. You can select the field that corresponds to the value you want. In this case I would choose PRODUCT _NAME. I don’t need to format this field, but you will want to format fields such as your prices with a currency format.

That’s It! You can follow the same steps and bind any of the hidden fields to your dataset.

Here are a couple of extras tips:

You can use this piece of code for a hidden field that you can use to charge shipping based on weight not a flat value.

<input name="shipping" type="hidden" value="<%=(rsall.Fields.Item(" SHIPPING_CHARGE").Value) %>">

And you can use this piece of code to charge a single fee per order.

<input type="hidden" name="handling_cart" value=" 5.00">

You can change the values to fit your needs. Just insert the piece of code anywhere among the other inputs of your Paypal button.

 

Add comment


Security code
Refresh

Popular Posts

prev   |   next
  • Is something broken? new
    Is something broken? If something is broken on our site we are sorry for any inconvenience that it has caused you, please report it here so that we can fix it right away!
    by:admin Offline
    hits:5
  • Request a Tutorial new
    Request that we list a great tutorial you found, tell us what you would like to see more of, or let us help you find that hard to find tutorial.
    by:admin Offline
    hits:2
  • Top Rated Module -> AJAX Rating Stand Alone fo... new
    We have had a request for a Top Rated Module that will complement the AJAX Rating Stand Alone for SOBI2 Plugin. We have started on this module and it should be ready in the very near future. We wi...
    by:admin Offline
    hits:7
  • how to display the category menu like ebay does new
    Someone asked us how to display the category menu like ebay does. This is possible, you could use the list limiter and only show the top two cats (or all if you wanted) and then use custom css...
    by:admin Offline
    hits:8

Featured Posts

prev   |   next
  • how to display the category menu like ebay does new
    Someone asked us how to display the category menu like ebay does. This is possible, you could use the list limiter and only show the top two cats (or all if you wanted) and then use custom css...
    by:admin Offline
    hits:8
  • Is something broken? new
    Is something broken? If something is broken on our site we are sorry for any inconvenience that it has caused you, please report it here so that we can fix it right away!
    by:admin Offline
    hits:5
  • Top Rated Module -> AJAX Rating Stand Alone fo... new
    We have had a request for a Top Rated Module that will complement the AJAX Rating Stand Alone for SOBI2 Plugin. We have started on this module and it should be ready in the very near future. We wi...
    by:admin Offline
    hits:7
  • Fatal error: Call to undefined function sefre... new
    Here is what I get, don't know why...the "home" link is working, but virtuemart categories won't show, instead: Warning: Invalid argument supplied for foreach() in ..../mod_vm_css_menu/helper.p...
    by:guest Offline
    hits:5