WordPress Plugin: Enhanced Paypal Shortcodes
Enhanced Paypal Shortcodes is a plugin that I developed to make it easy for site owners to add a paypal button to their page or post, without having to ‘battle’ with the html editor.
This plugin is inspired by Paypal Shortcodes by Paolo Tresso (aka Pixline). This was an excellent plugin but only allowed for Add To Cart and View Cart functions – not really what I was looking for.
Features:
- Use shortcodes to insert Buy Now, Subscribe, Add To Cart or Hosted (or saved) Paypal buttons to your wordpress page or post.
- Ability to add most optional Paypal settings (see details below)
- Formatting of button
Current Version:
Download Version 0.5a (right click and choose Save As)
Previous Versions:
Download Ver 0.4 (right click and choose Save As)
Download Ver 0.3 (right click and choose Save As)
Download Ver 0.2 (right click and choose Save As)
Download Ver 0.1 (right click and choose Save As)
Installation Instructions
Download zip file to your computer
Login to wp-admin and navigate to Tools -> Plugins -> Add New
Click on the Upload link
Click on the Browse button and navigate to the folder where you downloaded the plugin to
Select the file and click open, then click Install Now
Click on Activate Now and your plugin is installed.
Parameters for Shortcode for all Paypal buttons
Using Enhanced Paypal Shortcodes
To use the Enhanced Paypal Shortcodes, simply place the shortcode where you want your paypal button to appear and enter the parameters you need.
Sample Usage:
Buy Now Button:
[ paypal type="paynow" amount="12.99" email="youremail@domainname.com" itemno="12345657" name="Description" noshipping="1" nonote="1" qty="1" shipping="4.00" shipping2="1.00" currencycode="USD" imageurl="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif" rm="2" notifyurl="http://notifyurl.com" returnurl="http://returnurl.com" scriptcode="scriptcode" imagewidth="100px" pagestyle="primary" lc="AU" cbt="Complete Your Purchase" ]
*note: remove the spaces from between the [ ]
This gives this button:
Subscribe Button with 2 trial periods and recurring Monthly payments.
[ paypal type="subscribe" email="youremail@domainname.com" itemno="12345657" name="Description" noshipping="1" currencycode="USD" imageurl="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif" a1="1" p1="7" t1="D" a2="3" p2="1" t3="M" a3="47" p3="1" t3="M" rm="2" modify="2" notifyurl="http://notifyurl.com" returnurl="http://returnurl.com" scriptcode="scriptcode" imagewidth="100px" pagestyle="paypal" lc="AU" cbt="Complete Your Purchase" ]
*note: remove the spaces from between the [ ]
This gives this button:
Paypal Hosted Buttons
[ paypal type="hosted" buttonid="1234456" imageurl="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif" ]
*note: remove the spaces from between the [ ]
Parameters & Frequently Asked Questions
- Why would I use this plugin
-
We created this plugin to make it easy for WordPress website owners to embed paypal buttons in their posts or pages.
Whilst it is possible to paste the html code provided by Paypal into the page or post using the html editor, we’ve found that it can cause problems if the entry is then edited using the Visual editor.
This plugin provides a shortcode that will allow the site owner to specify the parameters for the paypal button required and automatically create the button when the page is displayed.
You can download the plugin from the wordpress repository: Enhanced Paypal Shortcodes
- What paypal buttons are supported?
-
The Enhanced Paypal Shortcodes plugins will allow you to create:
- Pay Now
- Subscribe
- Add To Cart
- Hosted
buttons on your website by using a shortcode within your Page or Post.
- How do I use the Enhanced Paypal Shortcodes plugin?
-
You use this plugin by adding the shortcode [ paypal ] to your sites pages or posts. There are a series of parameters that are used to ‘code’ the paypal button. (Be sure to remove the space after the “[" and before the "]” to make the code work)
The full list of supported parameters are:
type = paynow, subscribe, addtocart or hosted
*RequiredFor Hosted Buttons:
buttonid = the button id number from your paypal codeFor All Button Types:
imageurl = The location of the image for the button. Use full web address for the image – e.g http://domainname.com/mybuynowbutton.jpg.
Default is https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gifimagewidth = the width of the paypal image
Default is 100% of the image specifiedFor PayNow, Subscribe and Add To Cart Buttons:
email = the email address of the paypal account
*Requireditemno = A unique identifier for your product / service
*Requiredname = Description of product / service
*Requirednoshipping = Prompt for Shipping address
Options:
0 is prompt, but don’t require
1 is don’t prompt
2 is prompt and require the shipping address
Default is 0currencycode = The currency for the transaction
Australian Dollar AUD
Canadian Dollar CAD
Czech Koruna CZK
Danish Krone DKK
Euro EUR
Hong Kong Dollar HKD
Hungarian Forint HUF
Israeli New Sheqel ILS
Japanese Yen JPY
Mexican Peso MXN
Norwegian Krone NOK
New Zealand Dollar NZD
Polish Zloty PLN
Pound Sterling GBP
Singapore Dollar SGD
Swedish Krona SEK
Swiss Franc CHF
U.S. Dollar USD
Default is USDrm = The return method. This will only work if returnurl is also set. This variable is often required by membership type software
0 – all shopping cart transactions use the GET method
1 – the payer’s browser is redirected to the return URL by the GET method, and no transaction variables are sent
2 – the payer’s browser is redirected to the return URL by the POST method, and all transaction variables are also posted
Default is 0.notifyurl = The URL to send payment advice too. Often required for IPN or other notifications. If this parameter is not used, no notifyurl value is added to the button
returnurl = The URL to which the payer’s browser is redirected after completing the payment; for example, a URL on your site that displays a “Thank you for your payment” page.
Default – The browser is redirected to a PayPal web page.cancelurl = The URL to which the payer’s browser is redirected if the purchaser cancels the payment transaction before completing the process
scriptcode = the link to any script code that you may need to include. e.g For Jrox JAM, some script code is added to the paypal buttons. Usage /foldername/scriptcode.php
If this parameter is not used, no notifyurl value is added to the buttonpagestyle = The custom payment page style for checkout pages. Allowable values:
paypal – use the PayPal page style
primary – use the page style that you marked as primary in your account profile
page_style_name – use the custom payment page style from your account profile that has the specified name
Default is primary if you added a custom payment page style to your account profile. Otherwise, the default is paypal.cbt = Sets the text for the Return to Merchant button on the PayPal Payment Complete page. For Business accounts, the return button displays your business name in place of the word “Merchant” by default. For Donate buttons, the text reads “Return to donations coordinator” by default.
NOTE: The returnurl variable must also be set.cn = Label that appears above the note field on the Check Out page. This value is not saved and will not appear in any of your notifications. If omitted, the default label above the note field is “Add special instructions to merchant.” The cn variable is not valid with Subscribe buttons or if you include nonote=”1″.
lc = Sets the payer’s language for the billing information/log-in page only.
The default is US. For allowable values visit: https://cms.paypal.com/au/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_countrycodesPaynow & Add To Cart Button only parameters
amount = the amount to charge (for Paynow & Add To Cart buttons only)
*Required for Add To Cart Buttons
If left blank on PayNow, paypal will ask for an amount to payqty = The quantity to pay for or add to cart.
ask will let the purchaser specify how many they wish to purchase or add
or set the number greater than 0 to force a specific quantity
If omitted from the shortcode, a quantity of 1 is used.nonote = Prompt payers to include a note (Paynow buttons only)
0 is show the note box and prompt the user
1 is hide the note box and do not prompt the user
Default is 0shipping = the amount of shipping to charge per item
shipping2 = the amount of shipping to charge for each extra item purchased.
Subscribe Button only parameters
For Subscription buttons, you can specify 2 trial periods and the full recurring payment.
Trial Period 1:
a1 = The value to charge for the first trial period
p1 = The duration of the first trial.
t1 = The units of duration.
D for Days, allowable entries for p1: 1 to 90
W for Weeks, allowable entries for p1: 1 to 52
M for Months, allowable entries for p1: 1 to 24
Y for Years, allowable entries for p1: 1 to 5Trial Period 2:
a2 = The value to charge for the second trial period
p2 = The duration of the second trial.
t2 = The units of duration.
D for Days, allowable entries for p2: 1 to 90
W for Weeks, allowable entries for p2: 1 to 52
M for Months, allowable entries for p2: 1 to 24
Y for Years, allowable entries for p2: 1 to 5The full subscription Payment:
a3 = The value to charge
p3 = The duration between charging
t3 = The units of duration.
D for Days, allowable entries for p3: 1 to 90
W for Weeks, allowable entries for p3: 1 to 52
M for Months, allowable entries for p3: 1 to 24
Y for Years, allowable entries for p3: 1 to 5src = Recurring payments. Subscription payments recur unless subscribers cancel their subscriptions before the end of the current billing cycle or you limit the number of times that payments recur with the value that you specify for srt.
Allowable values:
0 – subscription payments do not recur
1 – subscription payments recur
Default is 0.srt = Recurring times. Number of times that subscription payments recur. Specify an integer above 1. Valid only if you specify src=”1″. If omitted, the payment recurs indefinitely.
Allowable values:an integer above 1.sra = Reattempt on failure. If a recurring payment fails, PayPal attempts to collect the payment two more times before canceling the subscription.
Allowable values:
0 – do not reattempt failed recurring payments
1 – reattempt failed recurring payments before canceling
Default is 0modify – Modification behavior. Allowable values:
0 – allows subscribers to only create new subscriptions
1 – allows subscribers to modify their current subscriptions or sign up for new ones
2 – allows subscribers to only modify their current subscriptions
Default is 0Add To Cart
display = Display the contents of the PayPal Shopping Cart to the buyer. If set, the shopping cart will be displayed after an item is added. If not set, the item will be added to the cart only.
Set display=1 for the shopping cart to be displayed.Formatting All Buttons
The plugin will wrap the paypal button in a <div> tag. The formatting options available are:divwidth = the width of the div. This should be at least the width of the image.
Default is 100%textalign = the alignment of the image / text within the div
Allowable values:
left – text is left justified
right – text is right justified
center – text is centered
Default is none, the alignment is taken from the theme or pagefloat = position of the div on the page
left – the div ‘floats’ on the left
right – the div ‘floats’ on the right
Default – if this value is missing, the div is centered on the page according to the divwidth parametermarginleft = the amount of space between the div and the text to the left of the div (particularly good to use when using float=right)
Default – if this value is missing, the page format is usedmarginright = the amount of space between the div and the text to the right of the div
(particularly good to use when using float=left)
Default – if this value is missing, the page format is usedmargintop = the amount of space to the line above the div
Default is 10pxmarginbottom = the amount of space to the line below the div
Default is 10pxButton Formatting
As images are inserted into the plugin code, these images will ‘pick up’ the formatting for images specified in the theme. This often causes issues with borders or backgrounds being added.To allow more flexibility to the site owner, a class has been added to each of the images used so that the site owner can override any default formatting.
Image Classes:
Pixel tracking image
The shortcode will add a ‘placeholder’ Paypal image that is 1px wide by 1px tall into the button. The code adds a class of “ppalholder” to this image. This will allow site owners to add the class to their theme styles and remove any borders that cause the image to be ‘visible’.
Use the style format of:
.ppalholder { };
in your themes stylesheet or custom stylesheet to change any default formats for this image.
Class added to Buy Now, Add To Cart, Hosted or Subscribe button
The code will add the class “ppalbtn” to the actual image embedded on the page to allow for more formatting choices.
Use the style format of:
.ppalbtn { };
in your themes stylesheet or custom stylesheet to change any default formats for this image.
- How do I add a Buy Now button with the Enhanced Paypal Shortcodes plugin?
-
To create a Buy Now button on your site, insert the shortcode whereever you want to appear.
Supported parameters are:
type = paynow
*Requiredemail = the email address of the paypal account
*Requireditemno = A unique identifier for your product / service
*Requiredname = Description of product / service
*Requiredamount = the amount to charge (for Paynow & Add To Cart buttons only)
*Requiredqty = The quantity to pay for or add to cart.
ask will let the purchaser specify how many they wish to purchase or add
or set the number greater than 0 to force a specific quantity
If omitted from the shortcode, a quantity of 1 is used.nonote = Prompt payers to include a note (Paynow buttons only)
0 is show the note box and prompt the user
1 is hide the note box and do not prompt the user
Default is 0shipping = the amount of shipping to charge per item
shipping2 = the amount of shipping to charge for each extra item purchased.
imageurl = The location of the image for the button. Use full web address for the image – e.g http://domainname.com/mybuynowbutton.jpg.
Default is https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gifimagewidth = the width of the paypal image
Default is 100% of the image specifiednoshipping = Prompt for Shipping address
Options:
0 is prompt, but don’t require
1 is don’t prompt
2 is prompt and require the shipping address
Default is 0currencycode = The currency for the transaction
Australian Dollar AUD
Canadian Dollar CAD
Czech Koruna CZK
Danish Krone DKK
Euro EUR
Hong Kong Dollar HKD
Hungarian Forint HUF
Israeli New Sheqel ILS
Japanese Yen JPY
Mexican Peso MXN
Norwegian Krone NOK
New Zealand Dollar NZD
Polish Zloty PLN
Pound Sterling GBP
Singapore Dollar SGD
Swedish Krona SEK
Swiss Franc CHF
U.S. Dollar USD
Default is USDrm = The return method. This will only work if returnurl is also set. This variable is often required by membership type software
0 – all shopping cart transactions use the GET method
1 – the payer’s browser is redirected to the return URL by the GET method, and no transaction variables are sent
2 – the payer’s browser is redirected to the return URL by the POST method, and all transaction variables are also posted
Default is 0.notifyurl = The URL to send payment advice too. Often required for IPN or other notifications. If this parameter is not used, no notifyurl value is added to the button
returnurl = The URL to which the payer’s browser is redirected after completing the payment; for example, a URL on your site that displays a “Thank you for your payment” page.
Default – The browser is redirected to a PayPal web page.cancelurl = The URL to which the payer’s browser is redirected if the purchaser cancels the payment transaction before completing the process
scriptcode = the link to any script code that you may need to include. e.g For Jrox JAM, some script code is added to the paypal buttons. Usage /foldername/scriptcode.php
If this parameter is not used, no notifyurl value is added to the buttonpagestyle = The custom payment page style for checkout pages. Allowable values:
paypal – use the PayPal page style
primary – use the page style that you marked as primary in your account profile
page_style_name – use the custom payment page style from your account profile that has the specified name
Default is primary if you added a custom payment page style to your account profile. Otherwise, the default is paypal.cbt = Sets the text for the Return to Merchant button on the PayPal Payment Complete page. For Business accounts, the return button displays your business name in place of the word “Merchant” by default. For Donate buttons, the text reads “Return to donations coordinator” by default.
NOTE: The returnurl variable must also be set.cn = Label that appears above the note field on the Check Out page. This value is not saved and will not appear in any of your notifications. If omitted, the default label above the note field is “Add special instructions to merchant.” The cn variable is not valid with Subscribe buttons or if you include nonote=”1″.
lc = Sets the payer’s language for the billing information/log-in page only.
The default is US. For allowable values visit: https://cms.paypal.com/au/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_countrycodesFormatting All Buttons
The plugin will wrap the paypal button in a <div> tag. The formatting options available are:
divwidth = the width of the div. This should be at least the width of the image.
Default is 100%textalign = the alignment of the image / text within the div
Allowable values:
left – text is left justified
right – text is right justified
center – text is centered
Default is none, the alignment is taken from the theme or pagefloat = position of the div on the page
left – the div ‘floats’ on the left
right – the div ‘floats’ on the right
Default – if this value is missing, the div is centered on the page according to the divwidth parametermarginleft = the amount of space between the div and the text to the left of the div (particularly good to use when using float=right)
Default – if this value is missing, the page format is usedmarginright = the amount of space between the div and the text to the right of the div
(particularly good to use when using float=left)
Default – if this value is missing, the page format is usedmargintop = the amount of space to the line above the div
Default is 10pxmarginbottom = the amount of space to the line below the div
Default is 10pxButton Formatting
As images are inserted into the plugin code, these images will ‘pick up’ the formatting for images specified in the theme. This often causes issues with borders or backgrounds being added.To allow more flexibility to the site owner, a class has been added to each of the images used so that the site owner can override any default formatting.
Image Classes:
Pixel tracking image
The shortcode will add a ‘placeholder’ Paypal image that is 1px wide by 1px tall into the button. The code adds a class of “ppalholder” to this image. This will allow site owners to add the class to their theme styles and remove any borders that cause the image to be ‘visible’.
Use the style format of:
.ppalholder { };
in your themes stylesheet or custom stylesheet to change any default formats for this image.
Class added to Buy Now, Add To Cart, Hosted or Subscribe button
The code will add the class “ppalbtn” to the actual image embedded on the page to allow for more formatting choices.
Use the style format of:
.ppalbtn { };
in your themes stylesheet or custom stylesheet to change any default formats for this image.
Example
[ paypal type="paynow" amount="12.99" email="youremail@domainname.com" itemno="12345657" name="Description" noshipping="1" nonote="1" qty="1" shipping="4.00" shipping2="1.00" currencycode="USD" imageurl="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif" rm="2" notifyurl="http://notifyurl.com" returnurl="http://returnurl.com" scriptcode="scriptcode" imagewidth="100px" pagestyle="paypal" lc="AU" cbt="Complete Your Purchase" ]
To allow purchasers to choose the quantity they wish to add to the cart
[ paypal type="paynow" amount="12.99" email="youremail@domainname.com" itemno="12345657" name="Description" noshipping="1" nonote="1" qty="ask" shipping="4.00" shipping2="1.00" currencycode="USD" imageurl="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif" rm="2" notifyurl="http://notifyurl.com" returnurl="http://returnurl.com" scriptcode="scriptcode" imagewidth="100px" pagestyle="paypal" lc="AU" cbt="Complete Your Purchase" ]
Notes:
- Be sure to remove the space after the “[" and before the "]” to make the code work
- Change email to your paypal email address
- How do I add a Subscription button with the Enhanced Paypal Shortcodes plugin?
-
To create a Subscription button on your site, insert the shortcode whereever you want to appear.
Supported parameters are:
type = subscribe
*Requiredemail = the email address of the paypal account
*Requireditemno = A unique identifier for your product / service
*Requiredname = Description of product / service
*Requiredimageurl = The location of the image for the button. Use full web address for the image – e.g http://domainname.com/mybuynowbutton.jpg.
Default is https://www.paypal.com/en_AU/i/btn/btn_subscribeCC_LG.gif
imagewidth = the width of the paypal image
Default is 100% of the image specifiednoshipping = Prompt for Shipping address
Options:
0 is prompt, but don’t require
1 is don’t prompt
2 is prompt and require the shipping address
Default is 0currencycode = The currency for the transaction
Australian Dollar AUD
Canadian Dollar CAD
Czech Koruna CZK
Danish Krone DKK
Euro EUR
Hong Kong Dollar HKD
Hungarian Forint HUF
Israeli New Sheqel ILS
Japanese Yen JPY
Mexican Peso MXN
Norwegian Krone NOK
New Zealand Dollar NZD
Polish Zloty PLN
Pound Sterling GBP
Singapore Dollar SGD
Swedish Krona SEK
Swiss Franc CHF
U.S. Dollar USD
Default is USDrm = The return method. This will only work if returnurl is also set. This variable is often required by membership type software
0 – all shopping cart transactions use the GET method
1 – the payer’s browser is redirected to the return URL by the GET method, and no transaction variables are sent
2 – the payer’s browser is redirected to the return URL by the POST method, and all transaction variables are also posted
Default is 0.notifyurl = The URL to send payment advice too. Often required for IPN or other notifications. If this parameter is not used, no notifyurl value is added to the button
returnurl = The URL to which the payer’s browser is redirected after completing the payment; for example, a URL on your site that displays a “Thank you for your payment” page.
Default – The browser is redirected to a PayPal web page.cancelurl = The URL to which the payer’s browser is redirected if the purchaser cancels the payment transaction before completing the process
scriptcode = the link to any script code that you may need to include. e.g For Jrox JAM, some script code is added to the paypal buttons. Usage /foldername/scriptcode.php
If this parameter is not used, no notifyurl value is added to the buttonpagestyle = The custom payment page style for checkout pages. Allowable values:
paypal – use the PayPal page style
primary – use the page style that you marked as primary in your account profile
page_style_name – use the custom payment page style from your account profile that has the specified name
Default is primary if you added a custom payment page style to your account profile. Otherwise, the default is paypal.cbt = Sets the text for the Return to Merchant button on the PayPal Payment Complete page. For Business accounts, the return button displays your business name in place of the word “Merchant” by default. For Donate buttons, the text reads “Return to donations coordinator” by default.
NOTE: The returnurl variable must also be set.cn = Label that appears above the note field on the Check Out page. This value is not saved and will not appear in any of your notifications. If omitted, the default label above the note field is “Add special instructions to merchant.” The cn variable is not valid with Subscribe buttons or if you include nonote=”1″.
lc = Sets the payer’s language for the billing information/log-in page only.
The default is US. For allowable values visit: https://cms.paypal.com/au/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_countrycodesFormatting All Buttons
The plugin will wrap the paypal button in a <div> tag. The formatting options available are:
divwidth = the width of the div. This should be at least the width of the image.
Default is 100%textalign = the alignment of the image / text within the div
Allowable values:
left – text is left justified
right – text is right justified
center – text is centered
Default is none, the alignment is taken from the theme or pagefloat = position of the div on the page
left – the div ‘floats’ on the left
right – the div ‘floats’ on the right
Default – if this value is missing, the div is centered on the page according to the divwidth parametermarginleft = the amount of space between the div and the text to the left of the div (particularly good to use when using float=right)
Default – if this value is missing, the page format is usedmarginright = the amount of space between the div and the text to the right of the div
(particularly good to use when using float=left)
Default – if this value is missing, the page format is usedmargintop = the amount of space to the line above the div
Default is 10pxmarginbottom = the amount of space to the line below the div
Default is 10pxFor Subscription buttons, you can specify 2 trial periods and the full recurring payment.
Trial Period 1:
a1 = The value to charge for the first trial period
p1 = The duration of the first trial.
t1 = The units of duration.
D for Days, allowable entries for p1: 1 to 90
W for Weeks, allowable entries for p1: 1 to 52
M for Months, allowable entries for p1: 1 to 24
Y for Years, allowable entries for p1: 1 to 5Trial Period 2:
a2 = The value to charge for the second trial period
p2 = The duration of the second trial.
t2 = The units of duration.
D for Days, allowable entries for p2: 1 to 90
W for Weeks, allowable entries for p2: 1 to 52
M for Months, allowable entries for p2: 1 to 24
Y for Years, allowable entries for p2: 1 to 5The full subscription Payment:
a3 = The value to charge
p3 = The duration between charging
t3 = The units of duration.
D for Days, allowable entries for p3: 1 to 90
W for Weeks, allowable entries for p3: 1 to 52
M for Months, allowable entries for p3: 1 to 24
Y for Years, allowable entries for p3: 1 to 5src = Recurring payments. Subscription payments recur unless subscribers cancel their subscriptions before the end of the current billing cycle or you limit the number of times that payments recur with the value that you specify for srt.
Allowable values:
0 – subscription payments do not recur
1 – subscription payments recur
Default is 0.srt = Recurring times. Number of times that subscription payments recur. Specify an integer above 1. Valid only if you specify src=”1″. If omitted, the payment recurs indefinitely.
Allowable values:an integer above 1.sra = Reattempt on failure. If a recurring payment fails, PayPal attempts to collect the payment two more times before canceling the subscription.
Allowable values:
0 – do not reattempt failed recurring payments
1 – reattempt failed recurring payments before canceling
Default is 0modify – Modification behavior. Allowable values:
0 – allows subscribers to only create new subscriptions
1 – allows subscribers to modify their current subscriptions or sign up for new ones
2 – allows subscribers to only modify their current subscriptions
Default is 0Button Formatting
As images are inserted into the plugin code, these images will ‘pick up’ the formatting for images specified in the theme. This often causes issues with borders or backgrounds being added.To allow more flexibility to the site owner, a class has been added to each of the images used so that the site owner can override any default formatting.
Image Classes:
Pixel tracking image
The shortcode will add a ‘placeholder’ Paypal image that is 1px wide by 1px tall into the button. The code adds a class of “ppalholder” to this image. This will allow site owners to add the class to their theme styles and remove any borders that cause the image to be ‘visible’.
Use the style format of:
.ppalholder { };
in your themes stylesheet or custom stylesheet to change any default formats for this image.
Class added to Buy Now, Add To Cart, Hosted or Subscribe button
The code will add the class “ppalbtn” to the actual image embedded on the page to allow for more formatting choices.
Use the style format of:
.ppalbtn { };
in your themes stylesheet or custom stylesheet to change any default formats for this image.
Example
[ paypal type="subscribe" email="youremail@domainname.com" itemno="12345657" name="Description" noshipping="1" currencycode="USD" imageurl="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif" a1="1" p1="7" t1="D" a2="3" p2="1" t3="M" a3="47" p3="1" t3="M" rm="2" modify="2" notifyurl="http://notifyurl.com" returnurl="http://returnurl.com" scriptcode="scriptcode" imagewidth="100px" pagestyle="paypal" lc="AU" cbt="Complete Your Purchase" ]
Notes:
- Be sure to remove the space after the “[" and before the "]” to make the code work
- Change email to your paypal email address
- How do I add an Add To Cart button with the Enhanced Paypal Shortcodes plugin?
-
To create an Add To Cart button on your site, insert the shortcode whereever you want to appear.
Supported parameters are:
type = addtocart
*Requiredemail = the email address of the paypal account
*Requireditemno = A unique identifier for your product / service
*Requiredname = Description of product / service
*Requiredamount = the amount to charge (for Paynow & Add To Cart buttons only)
*Requireddisplay = Display the contents of the PayPal Shopping Cart to the buyer. If set, the shopping cart will be displayed after an item is added. If not set, the item will be added to the cart only.
qty = The quantity to pay for or add to cart.
ask will let the purchaser specify how many they wish to purchase or add
or set the number greater than 0 to force a specific quantity
If omitted from the shortcode, a quantity of 1 is used.nonote = Prompt payers to include a note (Paynow buttons only)
0 is show the note box and prompt the user
1 is hide the note box and do not prompt the user
Default is 0shipping = the amount of shipping to charge per item
shipping2 = the amount of shipping to charge for each extra item purchased.
imageurl = The location of the image for the button. Use full web address for the image – e.g http://domainname.com/mybuynowbutton.jpg.
Default is https://www.paypalobjects.com/en_AU/i/btn/btn_cart_LG.gifimagewidth = the width of the paypal image
Default is 100% of the image specifiednoshipping = Prompt for Shipping address
Options:
0 is prompt, but don’t require
1 is don’t prompt
2 is prompt and require the shipping address
Default is 0currencycode = The currency for the transaction
Australian Dollar AUD
Canadian Dollar CAD
Czech Koruna CZK
Danish Krone DKK
Euro EUR
Hong Kong Dollar HKD
Hungarian Forint HUF
Israeli New Sheqel ILS
Japanese Yen JPY
Mexican Peso MXN
Norwegian Krone NOK
New Zealand Dollar NZD
Polish Zloty PLN
Pound Sterling GBP
Singapore Dollar SGD
Swedish Krona SEK
Swiss Franc CHF
U.S. Dollar USD
Default is USDrm = The return method. This will only work if returnurl is also set. This variable is often required by membership type software
0 – all shopping cart transactions use the GET method
1 – the payer’s browser is redirected to the return URL by the GET method, and no transaction variables are sent
2 – the payer’s browser is redirected to the return URL by the POST method, and all transaction variables are also posted
Default is 0.notifyurl = The URL to send payment advice too. Often required for IPN or other notifications. If this parameter is not used, no notifyurl value is added to the button
returnurl = The URL to which the payer’s browser is redirected after completing the payment; for example, a URL on your site that displays a “Thank you for your payment” page.
Default – The browser is redirected to a PayPal web page.cancelurl = The URL to which the payer’s browser is redirected if the purchaser cancels the payment transaction before completing the process
scriptcode = the link to any script code that you may need to include. e.g For Jrox JAM, some script code is added to the paypal buttons. Usage /foldername/scriptcode.php
If this parameter is not used, no notifyurl value is added to the buttonpagestyle = The custom payment page style for checkout pages. Allowable values:
paypal – use the PayPal page style
primary – use the page style that you marked as primary in your account profile
page_style_name – use the custom payment page style from your account profile that has the specified name
Default is primary if you added a custom payment page style to your account profile. Otherwise, the default is paypal.cbt = Sets the text for the Return to Merchant button on the PayPal Payment Complete page. For Business accounts, the return button displays your business name in place of the word “Merchant” by default. For Donate buttons, the text reads “Return to donations coordinator” by default.
NOTE: The returnurl variable must also be set.cn = Label that appears above the note field on the Check Out page. This value is not saved and will not appear in any of your notifications. If omitted, the default label above the note field is “Add special instructions to merchant.” The cn variable is not valid with Subscribe buttons or if you include nonote=”1″.
lc = Sets the payer’s language for the billing information/log-in page only.
The default is US. For allowable values visit: https://cms.paypal.com/au/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_countrycodesFormatting All Buttons
The plugin will wrap the paypal button in a <div> tag. The formatting options available are:
divwidth = the width of the div. This should be at least the width of the image.
Default is 100%textalign = the alignment of the image / text within the div
Allowable values:
left – text is left justified
right – text is right justified
center – text is centered
Default is none, the alignment is taken from the theme or pagefloat = position of the div on the page
left – the div ‘floats’ on the left
right – the div ‘floats’ on the right
Default – if this value is missing, the div is centered on the page according to the divwidth parametermarginleft = the amount of space between the div and the text to the left of the div (particularly good to use when using float=right)
Default – if this value is missing, the page format is usedmarginright = the amount of space between the div and the text to the right of the div
(particularly good to use when using float=left)
Default – if this value is missing, the page format is usedmargintop = the amount of space to the line above the div
Default is 10pxmarginbottom = the amount of space to the line below the div
Default is 10pxButton Formatting
As images are inserted into the plugin code, these images will ‘pick up’ the formatting for images specified in the theme. This often causes issues with borders or backgrounds being added.To allow more flexibility to the site owner, a class has been added to each of the images used so that the site owner can override any default formatting.
Image Classes:
Pixel tracking image
The shortcode will add a ‘placeholder’ Paypal image that is 1px wide by 1px tall into the button. The code adds a class of “ppalholder” to this image. This will allow site owners to add the class to their theme styles and remove any borders that cause the image to be ‘visible’.
Use the style format of:
.ppalholder { };
in your themes stylesheet or custom stylesheet to change any default formats for this image.
Class added to Buy Now, Add To Cart, Hosted or Subscribe button
The code will add the class “ppalbtn” to the actual image embedded on the page to allow for more formatting choices.
Use the style format of:
.ppalbtn { };
in your themes stylesheet or custom stylesheet to change any default formats for this image.
Example
[ paypal type="addtocart" amount="12.99" email="youremail@domainname.com" itemno="12345657" name="Description" noshipping="1" nonote="1" qty="1" shipping="4.00" shipping2="1.00" currencycode="USD" display="1" imageurl="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif" rm="2" notifyurl="http://notifyurl.com" returnurl="http://returnurl.com" scriptcode="scriptcode" imagewidth="100px" pagestyle="paypal" lc="AU" cbt="Complete Your Purchase" ]
To allow purchasers to set the number they wish to purchase:
[ paypal type="addtocart" amount="12.99" email="youremail@domainname.com" itemno="12345657" name="Description" noshipping="1" nonote="1" qty="ask" shipping="4.00" shipping2="1.00" currencycode="USD" display="1" imageurl="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif" rm="2" notifyurl="http://notifyurl.com" returnurl="http://returnurl.com" scriptcode="scriptcode" imagewidth="100px" pagestyle="paypal" lc="AU" cbt="Complete Your Purchase" ]Notes:
- Be sure to remove the space after the “[" and before the "]” to make the code work
- Change email to your paypal email address
- How do I add a Hosted Paypal button with the Enhanced Paypal Shortcodes plugin?
-
To create a Hosted Paypal button on your site, insert the shortcode whereever you want to appear.
Supported parameters are:
type = hosted
*Requiredbuttonid = the button id number from your paypal code
*Requiredimageurl = The location of the image for the button. Use full web address for the image – e.g http://domainname.com/mybuynowbutton.jpg.
Default is https://www.paypal.com/en_AU/i/btn/btn_subscribeCC_LG.gifimagewidth = the width of the paypal image
Default is 100% of the image specifiedFormatting All Buttons
The plugin will wrap the paypal button in a <div> tag. The formatting options available are:
divwidth = the width of the div. This should be at least the width of the image.
Default is 100%textalign = the alignment of the image / text within the div
Allowable values:
left – text is left justified
right – text is right justified
center – text is centered
Default is none, the alignment is taken from the theme or pagefloat = position of the div on the page
left – the div ‘floats’ on the left
right – the div ‘floats’ on the right
Default – if this value is missing, the div is centered on the page according to the divwidth parametermarginleft = the amount of space between the div and the text to the left of the div (particularly good to use when using float=right)
Default – if this value is missing, the page format is usedmarginright = the amount of space between the div and the text to the right of the div
(particularly good to use when using float=left)
Default – if this value is missing, the page format is usedmargintop = the amount of space to the line above the div
Default is 10pxmarginbottom = the amount of space to the line below the div
Default is 10pxButton Formatting
As images are inserted into the plugin code, these images will ‘pick up’ the formatting for images specified in the theme. This often causes issues with borders or backgrounds being added.
To allow more flexibility to the site owner, a class has been added to each of the images used so that the site owner can override any default formatting.
Image Classes:
Pixel tracking image
The shortcode will add a ‘placeholder’ Paypal image that is 1px wide by 1px tall into the button. The code adds a class of “ppalholder” to this image. This will allow site owners to add the class to their theme styles and remove any borders that cause the image to be ‘visible’.
Use the style format of:
.ppalholder { };
in your themes stylesheet or custom stylesheet to change any default formats for this image.
Class added to Buy Now, Add To Cart, Hosted or Subscribe button
The code will add the class “ppalbtn” to the actual image embedded on the page to allow for more formatting choices.
Use the style format of:
.ppalbtn { };
in your themes stylesheet or custom stylesheet to change any default formats for this image.
Example
[ paypal type="hosted" buttonid="1234456" imageurl="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif" imagewidth="100px" ]
Notes:
- Be sure to remove the space after the “[" and before the "]” to make the code work
- Change email to your paypal email address
- Can I change the size of my paypal button?
-
You can change the size of your button image using the imagewidth parameter in the shortcode.
For example, adding:
imagewidth=”200px”
will set the image to 200px wide.
- Can I specify my own image to use for the
-
Yes. The plugin allows you to specify the image you want to use for all button types.
To specify an image add the following parameter to your shortcode:
imageurl=”http://yourdomainname.com/pathto/yourimage.ext”
If the imageurl parameter is not specified in the shortcode, the default images used are:
PayNow buttons: https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif

Subscription buttons: https://www.paypal.com/en_AU/i/btn/btn_subscribeCC_LG.gif

Hosted buttons: https://www.paypal.com/en_AU/i/btn/btn_subscribeCC_LG.gif

Add To Cart buttons: https://www.paypalobjects.com/en_AU/i/btn/btn_cart_LG.gif

- I get a small square next to my Paypal Button, how do I fix this?
-
The paypal code inserts a ‘placeholder’ Paypal image that is 1px wide by 1px tall into the button. Many themes add a default border to images, and this border is also added to the paypal placeholder image.
We’ve added a class of “ppalholder” to the placeholder image so that a siteowner can format the image (like removing borders).
To remove borders on this image, add the following line to the themes style.css file, or custom css styling options:
.ppalholder {border:none; }
How do I request a new feature?
You can request a new feature to this plugin by adding a comment to this page. We won’t guarantee that all requests can be addressed, but we will add requests to the wishlist for the next version of the plugin.

