How to add a PayPal button to some wordpress posts
This is a two stage process:-
Stage 1: On the blog post that you want to add a Paypal ‘Buy Now’ button. Find the custom fields section and set the Key to ‘Price’ and the Value to how much the ‘Buy Now’ button is worth. See below
Stage 2: Add the code below to your wordpress template. Usually to only the singlepost.php page. However, you may wish to add this code to all of your templates pages that contain the wordpress loop.
-
You will need to edit the code below changing PAYPAL-EMAIL-ADDRESS to your paypal email address.
-
RETURN-SITE and CANCEL-SITE need to be changed to your website.
-
You may also want to change the currency setting from GBP to your local currency.
<?php $key=”Price”;
if (get_post_meta($post->ID, $key, true) != “”)
{
echo “<div class=’post-meta’>Price £”;
$amount = get_post_meta($post->ID, $key, true);
echo “$amount</div>”;
echo “<form action=’https://www.paypal.com/cgi-bin/webscr’ method=’post’>
<input type=’hidden’ name=’cmd’value=’_xclick’ />
<input type=’hidden’ name=’business’ value=’PAYPAL-EMAIL-ADDRESS’ />
<input type=’hidden’ name=’item_name’ value=’”;
echo the_title();
echo “‘ />
<input type=’hidden’ name=’amount’ value=’”;
echo “$amount”;
echo”‘ />
<input type=’hidden’ name=’return’ value=’RETURN-SITE’ />
<input type=’hidden’ name=’cancel_return’ value=’CANCEL-SITE’ />
<input type=’hidden’ name=’no_note’value=’1′ />
<input type=’hidden’ name=’currency_code’value=’GBP’ />
<input type=’hidden’ name=’lc’value=’K'/>
<input type=’hidden’ name=’bn’alue=’PP-BuyNowBF’ />
<input type=’image’ src=’https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif’
border=’0′ name=’submit’ alt=’Make payments with PayPal – it’s fast, free and secure!’ />
<img alt=” border=’0′ src=’https://www.paypal.com/en_US/i/scr/pixel.gif’
width=’1′ height=’1′ /><br />
</form>”;
}
?>
You can see this code working at workshopsolutionsonline.co.uk

eh.. amazing
shopgame.net had more sony psp, xbox, pc games, mac games, playstation, gamecube, nokla n-gage, more systems games.