<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Chris Ford &#187; PHP</title>
	<atom:link href="http://www.chrisfordblog.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chrisfordblog.com</link>
	<description>Just another blog</description>
	<lastBuildDate>Thu, 17 Dec 2009 21:30:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How to add a PayPal button to some wordpress posts</title>
		<link>http://www.chrisfordblog.com/2008/07/how-to-add-a-paypal-button-to-some-wordpress-posts/</link>
		<comments>http://www.chrisfordblog.com/2008/07/how-to-add-a-paypal-button-to-some-wordpress-posts/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 12:06:10 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Everything Else]]></category>
		<category><![CDATA[Geek]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://chrisfordblog.com/?p=16</guid>
		<description><![CDATA[This is a two stage process:- Stage 1: On the blog post that you want to add a Paypal &#8216;Buy Now&#8217; button. Find the custom fields section and set the Key to &#8216;Price&#8217; and the Value to how much the &#8216;Buy Now&#8217; button is worth. See below Stage 2: Add the code below to your [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">This is a two stage process:-</p>
<p>Stage 1: On the blog post that you want to add a Paypal &#8216;Buy Now&#8217; button. Find the custom fields section and set the Key to &#8216;Price&#8217; and the Value to how much the &#8216;Buy Now&#8217; button is worth. See below</p>
<p><span style="color: #551a8b; text-decoration: underline;"><a href="http://chrisfordblog.com/wp/wp-content/uploads/2008/07/customfield.jpg"></a><a href="http://chrisfordblog.com/wp/wp-content/uploads/2008/07/customfield.jpg"><img class="alignnone size-medium wp-image-17" title="customfield" src="http://chrisfordblog.com/wp/wp-content/uploads/2008/07/customfield-300x197.jpg" alt="" width="300" height="197" /></a></span></p>
<p>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  <a href="http://codex.wordpress.org/The_Loop">the wordpress loop</a>.</p>
<ul>
<li>
<div style="margin: 0cm 0cm 0pt;">You will need to edit the code below changing PAYPAL-EMAIL-ADDRESS to your paypal email address.</div>
</li>
<li>
<div style="margin: 0cm 0cm 0pt;">RETURN-SITE and CANCEL-SITE need to be changed to your website.</div>
</li>
<li>
<div style="margin: 0cm 0cm 0pt;">You may also want to change the currency setting from GBP to your local currency.</div>
</li>
</ul>
<p style="margin: 0cm 0cm 0pt;"><span id="more-16"></span><br />
&lt;?php $key=&#8221;Price&#8221;;</p>
<p style="margin: 0cm 0cm 0pt;">if (get_post_meta($post-&gt;ID, $key, true) != &#8220;&#8221;)</p>
<p style="margin: 0cm 0cm 0pt;">{</p>
<p style="margin: 0cm 0cm 0pt;">echo &#8220;&lt;div class=&#8217;post-meta&#8217;&gt;Price £&#8221;;</p>
<p style="margin: 0cm 0cm 0pt;">$amount = get_post_meta($post-&gt;ID, $key, true);</p>
<p style="margin: 0cm 0cm 0pt;">echo &#8220;$amount&lt;/div&gt;&#8221;;</p>
<p style="margin: 0cm 0cm 0pt;"> </p>
<p style="margin: 0cm 0cm 0pt;">echo &#8220;&lt;form action=&#8217;https://www.paypal.com/cgi-bin/webscr&#8217; method=&#8217;post&#8217;&gt;</p>
<p style="margin: 0cm 0cm 0pt;">&lt;input type=&#8217;hidden&#8217; name=&#8217;cmd&#8217;value=&#8217;_xclick&#8217; /&gt;</p>
<p style="margin: 0cm 0cm 0pt;">&lt;input type=&#8217;hidden&#8217; name=&#8217;business&#8217; value=&#8217;PAYPAL-EMAIL-ADDRESS&#8217; /&gt;</p>
<p style="margin: 0cm 0cm 0pt;">&lt;input type=&#8217;hidden&#8217; name=&#8217;item_name&#8217; value=&#8217;&#8221;;</p>
<p style="margin: 0cm 0cm 0pt;">echo the_title();</p>
<p style="margin: 0cm 0cm 0pt;">echo &#8220;&#8216; /&gt;</p>
<p style="margin: 0cm 0cm 0pt;">&lt;input type=&#8217;hidden&#8217; name=&#8217;amount&#8217; value=&#8217;&#8221;;</p>
<p style="margin: 0cm 0cm 0pt;">echo &#8220;$amount&#8221;;</p>
<p style="margin: 0cm 0cm 0pt;">echo&#8221;&#8216; /&gt;</p>
<p style="margin: 0cm 0cm 0pt;">&lt;input type=&#8217;hidden&#8217; name=&#8217;return&#8217; value=&#8217;RETURN-SITE&#8217; /&gt;</p>
<p style="margin: 0cm 0cm 0pt;">&lt;input type=&#8217;hidden&#8217; name=&#8217;cancel_return&#8217; value=&#8217;CANCEL-SITE&#8217; /&gt;</p>
<p style="margin: 0cm 0cm 0pt;">&lt;input type=&#8217;hidden&#8217; name=&#8217;no_note&#8217;value=&#8217;1&#8242; /&gt;</p>
<p style="margin: 0cm 0cm 0pt;">&lt;input type=&#8217;hidden&#8217; name=&#8217;currency_code&#8217;value=&#8217;GBP&#8217; /&gt;</p>
<p style="margin: 0cm 0cm 0pt;">&lt;input type=&#8217;hidden&#8217; name=&#8217;lc&#8217;value=&#8217;K'/&gt;</p>
<p style="margin: 0cm 0cm 0pt;">&lt;input type=&#8217;hidden&#8217; name=&#8217;bn&#8217;alue=&#8217;PP-BuyNowBF&#8217; /&gt;</p>
<p style="margin: 0cm 0cm 0pt;">&lt;input type=&#8217;image&#8217; src=&#8217;https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif&#8217;</p>
<p style="margin: 0cm 0cm 0pt;">border=&#8217;0&#8242; name=&#8217;submit&#8217; alt=&#8217;Make payments with PayPal &#8211; it&#8217;s fast, free and secure!&#8217; /&gt;</p>
<p style="margin: 0cm 0cm 0pt;">&lt;img alt=&#8221; border=&#8217;0&#8242; src=&#8217;https://www.paypal.com/en_US/i/scr/pixel.gif&#8217;</p>
<p style="margin: 0cm 0cm 0pt;">width=&#8217;1&#8242; height=&#8217;1&#8242; /&gt;&lt;br /&gt;</p>
<p style="margin: 0cm 0cm 0pt;">&lt;/form&gt;&#8221;;</p>
<p style="margin: 0cm 0cm 0pt;">}</p>
<p style="margin: 0cm 0cm 0pt;">?&gt;</p>
<p style="margin: 0cm 0cm 0pt;"> </p>
<p style="margin: 0cm 0cm 0pt;">You can see this code working at <a href="http://workshopsolutionsonline.co.uk">workshopsolutionsonline.co.uk</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisfordblog.com/2008/07/how-to-add-a-paypal-button-to-some-wordpress-posts/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
