PayPal Buy Now Button - Version 1.5

Version Description

  • Added ability to align button left, center, or right
Download this release

Release Info

Developer scottpaterson
Plugin Icon 128x128 PayPal Buy Now Button
Version 1.5
Comparing to
See all releases

Code changes from version 1.4 to 1.5

Files changed (2) hide show
  1. readme.txt +12 -3
  2. wp-ecommerce-paypal.php +19 -7
readme.txt CHANGED
@@ -5,11 +5,11 @@ Tags: ecommerce, paypal, button, buy now, shortcode, buy now button, paypal butt
5
  Author URI: https://wpplugin.org
6
  Requires at least: 3.0
7
  Tested up to: 4.1
8
- Stable tag: 1.4
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
12
- Convert your website to a eCommerce website and start selling your product in just a few minutes. No Coding Required.
13
 
14
  == Description ==
15
  = Overview =
@@ -20,6 +20,8 @@ Convert your website to a eCommerce website and start selling your product in ju
20
 
21
  * Easy PayPal Button works with any WordPress theme.
22
 
 
 
23
 
24
  = Easy PayPal Button Features =
25
 
@@ -54,7 +56,8 @@ Convert your website to a eCommerce website and start selling your product in ju
54
  > [Get Easy PayPal Button Pro >>](https://wpplugin.org/easy-paypal-button/)
55
 
56
 
57
- Trademarks held by their respective owners. This plugin is not affiliated wtih PayPal.
 
58
 
59
  == Installation ==
60
 
@@ -81,6 +84,9 @@ Yes, there is no limit to the amount you can put on one post / page, or your ent
81
 
82
  == Changelog ==
83
 
 
 
 
84
  = 1.4 =
85
  * New automatic button / shortcode inserter in your page / post editor
86
 
@@ -119,6 +125,9 @@ Yes, there is no limit to the amount you can put on one post / page, or your ent
119
 
120
  == Upgrade Notice ==
121
 
 
 
 
122
  = 1.4 =
123
  New automatic button / shortcode inserter in your page / post editor
124
 
5
  Author URI: https://wpplugin.org
6
  Requires at least: 3.0
7
  Tested up to: 4.1
8
+ Stable tag: 1.5
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
12
+ Convert your website to a eCommerce website and start selling your product in just a few minutes. No Coding Required. Official PayPal Partner.
13
 
14
  == Description ==
15
  = Overview =
20
 
21
  * Easy PayPal Button works with any WordPress theme.
22
 
23
+ * Developed by an Official PayPal Partner.
24
+
25
 
26
  = Easy PayPal Button Features =
27
 
56
  > [Get Easy PayPal Button Pro >>](https://wpplugin.org/easy-paypal-button/)
57
 
58
 
59
+ WPPlugin is an offical PayPal Partner. Various trademarks held by their respective owners.
60
+
61
 
62
  == Installation ==
63
 
84
 
85
  == Changelog ==
86
 
87
+ = 1.5 =
88
+ * Added ability to align button left, center, or right
89
+
90
  = 1.4 =
91
  * New automatic button / shortcode inserter in your page / post editor
92
 
125
 
126
  == Upgrade Notice ==
127
 
128
+ = 1.5 =
129
+ Added ability to align button left, center, or right
130
+
131
  = 1.4 =
132
  New automatic button / shortcode inserter in your page / post editor
133
 
wp-ecommerce-paypal.php CHANGED
@@ -7,7 +7,7 @@ Description: A simple and easy way to integrate PayPal into your WordPress websi
7
  Author: Scott Paterson
8
  Author URI: https://wpplugin.org
9
  License: GPL2
10
- Version: 1.4
11
  */
12
 
13
  /* Copyright 2014-2015 Scott Paterson
@@ -52,14 +52,18 @@ function wpecpp_InsertShortcode(){
52
 
53
  var scname = document.getElementById("scname").value;
54
  var scprice = document.getElementById("scprice").value;
 
 
55
 
56
  if(!scname.match(/\S/)) { alert("Item Name is required."); return false; }
57
  if(!scprice.match(/\S/)) { alert("Item Price is required."); return false; }
 
58
 
59
  document.getElementById("scname").value = "";
60
  document.getElementById("scprice").value = "";
 
61
 
62
- window.send_to_editor('[wpecpp name="' + scname + '" price="' + scprice + '"' + ']');
63
  }
64
  </script>
65
 
@@ -72,6 +76,8 @@ window.send_to_editor('[wpecpp name="' + scname + '" price="' + scprice + '"' +
72
 
73
  Item Name: </td><td><input type="text" name="scname" id="scname" value="">The name of the item</td><td></td></tr><tr><td>
74
  Item Price: </td><td><input type="text" name="scprice" id="scprice" value=""> Example format: 6.99</td><td></td></tr><tr><td>
 
 
75
 
76
  </td></tr><tr><td>
77
 
@@ -416,7 +422,7 @@ echo "If the customer goes to PayPal and successfully pays, where are they redir
416
  <br /><br /><br />
417
 
418
 
419
- Various trademarks held by their respective owners. This plugin is not affiliated wtih PayPal.
420
 
421
 
422
  </form>
@@ -517,7 +523,7 @@ add_shortcode('wpecpp', 'wpecpp_options');
517
  function wpecpp_options($atts) {
518
 
519
  // get shortcode user fields
520
- $atts = shortcode_atts(array('name' => 'Example Name','price' => '0.00','discount_rate' => '','discount_amount' => '','weight' => '','shipping' => '','item_id' => '','size' => ''), $atts);
521
 
522
  // get settings page values
523
  $options = get_option('wpecpp_settingsoptions');
@@ -717,9 +723,14 @@ if ($value['note'] == "2") { $note = "1"; }
717
  if ($value['weight_unit'] == "1") { $weight_unit = "lbs"; }
718
  if ($value['weight_unit'] == "2") { $weight_unit = "kgs"; }
719
 
 
 
 
 
 
720
  $output = "";
721
- $output .= "<div><table style='border: none;'><tr>";
722
- $output .= "<td style='border: none;'><form target='$target' action='https://www.$path.com/cgi-bin/webscr' method='post'>";
723
  $output .= "<input type='hidden' name='cmd' value='_xclick' />";
724
  $output .= "<input type='hidden' name='business' value='$account' />";
725
  $output .= "<input type='hidden' name='item_name' value='". $atts['name'] ."' />";
@@ -737,10 +748,11 @@ $output .= "<input type='hidden' name='item_number' value='". $atts['item_id'] .
737
  $output .= "<input type='hidden' name='lc' value='$language'>";
738
  $output .= "<input type='hidden' name='no_note' value='$note'>";
739
  $output .= "<input type='hidden' name='return' value='". $value['return'] ."' />";
 
740
  $output .= "<input type='hidden' name='cancel_return' value='". $value['cancel'] ."' />";
741
  $output .= "<input style='border: none;' class='paypalbuttonimage' type='image' src='$img' border='0' name='submit' alt='Make your payments with PayPal. It is free, secure, effective.'>";
742
  $output .= "<img alt='' border='0' src='https://www.paypal.com/$language/i/scr/pixel.gif' width='1' height='1'>";
743
- $output .= "</form></td></tr></table></div>";
744
 
745
  return $output;
746
 
7
  Author: Scott Paterson
8
  Author URI: https://wpplugin.org
9
  License: GPL2
10
+ Version: 1.5
11
  */
12
 
13
  /* Copyright 2014-2015 Scott Paterson
52
 
53
  var scname = document.getElementById("scname").value;
54
  var scprice = document.getElementById("scprice").value;
55
+ var alignmentc = document.getElementById("alignment");
56
+ var alignmentb = alignmentc.options[alignmentc.selectedIndex].value;
57
 
58
  if(!scname.match(/\S/)) { alert("Item Name is required."); return false; }
59
  if(!scprice.match(/\S/)) { alert("Item Price is required."); return false; }
60
+ if(alignmentb == "none") { var alignment = ""; } else { var alignment = ' align="' + alignmentb + '"'; };
61
 
62
  document.getElementById("scname").value = "";
63
  document.getElementById("scprice").value = "";
64
+ alignmentc.selectedIndex = null;
65
 
66
+ window.send_to_editor('[wpecpp name="' + scname + '" price="' + scprice + '"' + alignment + ']');
67
  }
68
  </script>
69
 
76
 
77
  Item Name: </td><td><input type="text" name="scname" id="scname" value="">The name of the item</td><td></td></tr><tr><td>
78
  Item Price: </td><td><input type="text" name="scprice" id="scprice" value=""> Example format: 6.99</td><td></td></tr><tr><td>
79
+ Alignment: </td><td><select name="alignment" id="alignment"><option value="none"></option><option value="left">Left</option><option value="center">Center</option><option value="right">Right</option></select>
80
+ Optional</td><td></td></tr><tr><td>
81
 
82
  </td></tr><tr><td>
83
 
422
  <br /><br /><br />
423
 
424
 
425
+ WPPlugin is an offical PayPal Partner. Various trademarks held by their respective owners.
426
 
427
 
428
  </form>
523
  function wpecpp_options($atts) {
524
 
525
  // get shortcode user fields
526
+ $atts = shortcode_atts(array('name' => 'Example Name','price' => '0.00','discount_rate' => '','discount_amount' => '','weight' => '','shipping' => '','item_id' => '','size' => '','align' => ''), $atts);
527
 
528
  // get settings page values
529
  $options = get_option('wpecpp_settingsoptions');
723
  if ($value['weight_unit'] == "1") { $weight_unit = "lbs"; }
724
  if ($value['weight_unit'] == "2") { $weight_unit = "kgs"; }
725
 
726
+ // alignment
727
+ if ($atts['align'] == "left") { $alignment = "style='float: left;'"; }
728
+ if ($atts['align'] == "right") { $alignment = "style='float: right;'"; }
729
+ if ($atts['align'] == "center") { $alignment = "style='margin-left: auto;margin-right: auto;width:107px'"; }
730
+
731
  $output = "";
732
+ $output .= "<div $alignment>";
733
+ $output .= "<form target='$target' action='https://www.$path.com/cgi-bin/webscr' method='post'>";
734
  $output .= "<input type='hidden' name='cmd' value='_xclick' />";
735
  $output .= "<input type='hidden' name='business' value='$account' />";
736
  $output .= "<input type='hidden' name='item_name' value='". $atts['name'] ."' />";
748
  $output .= "<input type='hidden' name='lc' value='$language'>";
749
  $output .= "<input type='hidden' name='no_note' value='$note'>";
750
  $output .= "<input type='hidden' name='return' value='". $value['return'] ."' />";
751
+ $output .= "<input type='hidden' name='bn' value='WPPlugin_SP'>";
752
  $output .= "<input type='hidden' name='cancel_return' value='". $value['cancel'] ."' />";
753
  $output .= "<input style='border: none;' class='paypalbuttonimage' type='image' src='$img' border='0' name='submit' alt='Make your payments with PayPal. It is free, secure, effective.'>";
754
  $output .= "<img alt='' border='0' src='https://www.paypal.com/$language/i/scr/pixel.gif' width='1' height='1'>";
755
+ $output .= "</form></div>";
756
 
757
  return $output;
758