Adding buy now buttons
PayPal buttons
To create a PayPal button, go to the 'Product List' page. Against each product is a 'Show button' link which takes you to a button generator page where you can copy the text and paste it on to your web page.
Clicking on a 'Buy now' button immediately takes you to the checkout where you buy that single item.
The button or buttons may be placed anywhere on an existing web page which makes it easy to integrate into an existing design. The web page can be of php extension or an ordinary htm page.
<input type="hidden" name="item_number" value="item1">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but23.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
The fields that you enter to create the button are :
- The action url is http://www.yourservername/phpkeycodes/ipn/process.php assuming that you have installed PHP-KeyCodes at the root of your web site in a folder called 'phpkeycodes'.
- The value is the item_number for the product you wish to create the button for. This is the value that you gave the item in the Products display of the admin pages.
- The image can be any of the PayPal images or one of your own.
Click on the following button which shows what happens when someone wants to buy from PHP-KeyCodes.
When the purchaser clicks on the buy now button, the php script will extract all the relevant data from the database and post it to the PayPal server.
adding a text box for customer input
PayPal has a field called 'custom' which is a pass through field where any data entered into the field will be passed unchanged to PayPal and returned within the IPN.
In PHP-KeyCodes, entering text into the custom field is returned with the IPN payment details and the data is stored in the tblsaleshistory table along with all the other PayPal details and the purchased licence codes.
This allows you to request details from the customer such as a customer reference number or Phone model.
To do this, add a text input box to the form field which will look like the following :
The code for the button is as follows :
<input type="hidden" name="item_number" value="item1">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but23.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
Customer input : <input type="text" name="custom" class="inputbox" />
</form>
The only addition is a text input box with a name of "custom".
The custom variable has a maximum size of 255 characters.
Google buttons
To create a Google button, go to the 'Product List' page. Against each product is a 'Show button' link which takes you to a button generator page where you can copy the text and paste it on to your web page.
Clicking on a 'Buy now' button immediately takes you to the checkout where you buy that single item.
The button or buttons may be placed anywhere on an existing web page which makes it easy to integrate into an existing design. The web page can be of php extension or an ordinary htm page.
<input type="hidden" name="item_number" value="item1">
<input type="image" src="http://www.yoursevername.com/checkout_buy.gif"
border="0" name="submit" alt="Google checkout">
</form>
The fields that you enter to create the button are :
- The action url is http://www.yourservername/google/process.php assuming that you have installed PHP-KeyCodes at the root of your web site in a folder called 'phpkeycodes'.
- The value is the item_number for the product you wish to create the button for. This is the value that you gave the item in the Products display of the admin pages.
- The image can be any of the Google images or one of your own.
Click on the following button which shows what happens when someone wants to buy from PHP-KeyCodes.
When the purchaser clicks on the buy now button, the php script will extract all the relevant data from the database and post it to Google.

