Manually Created Buttons

This section illustrates how you create a "Buy now button", an "Add to Cart" button and a "View Cart" button. These may be used in situations where you have existing text on a web page and just want to add a button at an appropriate place.

The buttons can be placed on any web page format - it can be a PHP page or an ordinary html page.

For this you will be using the yourbasket.php file in the basket folder to show the shopping cart results.

Buy Now Buttons

This illustrates a single item buy now button which goes straight to PayPal. Copy the text from below and modify as described:

<form action="https://www.yourserver.com/phpeseller/ipn/process.php" method="post">
    <input type="hidden" name="recid" value="1" />
    <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>

You need to enter the action url which is the full url of the process.php page. This is located in the installation folder which in the example above is https://www.yourserver.com/phpeseller and then followed by the location of process.php which is /ipn/process.php

You also need the record id of the product item. In the example above this is "1". You can get the record id of the item by looking at the product list in the admin area.

The button image can be any image that you want. I have used a standard PayPal image.

The following buttons are linked to my demo site.

A Digital Item

A Physical Item


Add to Cart Buttons

 <form action="https://www.yourserver.com/phpeseller/basket/yourbasket.php" method="post">
    <input type="hidden" name="recid" value="34">
    <input type="hidden" name="action" value="add">
    <input type="hidden" name="from" value="https://www.yourserver.com/phpeseller/basket/examples.php">
    <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but22.gif"
        alt="Add item to cart">
</form>

You need to enter the action url which is the full url of the yourbasket.php page. This is located in the installation folder which in the example above is https://www.yourserver.com/phpeseller and then followed by the location of yourbasket.php which is /basket/yourbasket.php

You also need the record id of the product item. In the example above this is "34". You can get the record id of the item by looking at the product list in the admin area.

You also need the action hidden field value, which will be "add".

You can enter a "from" url which is the full url that you want the page to return to when you click on "Continue Shopping" link.

The button image can be any image that you want. I have used a standard PayPal image.

The following buttons are linked to my demo site.

Physical Item 1

Physical Item 2

Digital Item 1


View Cart Button

And finally, a view cart button to display the shopping basket.

<form action="https://www.yourserver.com/phpeseller/basket/yourbasket.php" method="post">
    <input type="hidden" name="from" value="https://www.yourserver.com/phpeseller/basket/examples.php">
    <input type="image" src="https://www.paypal.com/en_US/i/btn/view_cart_02.gif"
        alt="view cart">
</form>

You need to enter the action url which is the full url of the yourbasket.php page. This is located in the installation folder which in the example above is https://www.yourserver.com/phpeseller and then followed by the location of yourbasket.php which is /basket/yourbasket.php

You can enter a "from" url which is the full url that you want the page to return to when you click on "Continue Shopping" link.

The button image can be any image that you want. I have used a standard PayPal image.

The following button is linked to my demo site.