|
01 August 2008
Posted in
Our Tutorials -
Dreamweaver
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.
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.
And you should get a popup menu like this:
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.
|
| Next > |
|---|



Dynamically Generate Paypal Buttons 






