WordPress Simple PayPal Shopping Cart - Version 4.1.3

Version Description

  • Updated the WP_Widget initialization to use PHP5 style constructor.
  • There is a bug in WordPress 4.3 for the widgets which prevents the sidebar widget from working. WordPress 4.3.1 will fix this. In the meantime you can use the following to show the shopping cart widget to the sidebar: https://www.tipsandtricks-hq.com/ecommerce/adding-shopping-cart-to-the-sidebar-of-wordpress-site-3073
Download this release

Release Info

Developer mra13
Plugin Icon 128x128 WordPress Simple PayPal Shopping Cart
Version 4.1.3
Comparing to
See all releases

Code changes from version 4.1.0 to 4.1.3

class-coupon.php CHANGED
@@ -3,7 +3,7 @@ class WPSPSC_Coupons_Collection
3
  {
4
  var $coupon_items = array();
5
 
6
- function WPSPSC_Coupons_Collection()
7
  {
8
 
9
  }
@@ -73,7 +73,7 @@ class WPSPSC_COUPON_ITEM
73
  var $coupon_code;
74
  var $discount_rate;
75
  var $expiry_date;
76
- function WPSPSC_COUPON_ITEM($coupon_code, $discount_rate, $expiry_date)
77
  {
78
  $this->id = uniqid();
79
  $this->coupon_code = $coupon_code;
3
  {
4
  var $coupon_items = array();
5
 
6
+ function __construct()
7
  {
8
 
9
  }
73
  var $coupon_code;
74
  var $discount_rate;
75
  var $expiry_date;
76
+ function __construct($coupon_code, $discount_rate, $expiry_date)
77
  {
78
  $this->id = uniqid();
79
  $this->coupon_code = $coupon_code;
includes/wspsc-cart-functions.php CHANGED
@@ -56,7 +56,7 @@ function print_wp_shopping_cart($args = array()) {
56
  global $plugin_dir_name;
57
  $output .= '<div class="shopping_cart">';
58
  if (!get_option('wp_shopping_cart_image_hide')) {
59
- $output .= "<img src='" . WP_CART_URL . "/images/shopping_cart_icon.png' value='" . (__("Cart", "WSPSC")) . "' title='" . (__("Cart", "WSPSC")) . "' />";
60
  }
61
  if (!empty($title)) {
62
  $output .= '<h2>';
@@ -64,7 +64,7 @@ function print_wp_shopping_cart($args = array()) {
64
  $output .= '</h2>';
65
  }
66
 
67
- $output .= '<br /><span id="pinfo" style="display: none; font-weight: bold; color: red;">' . (__("Hit enter to submit new Quantity.", "WSPSC")) . '</span>';
68
  $output .= '<table style="width: 100%;">';
69
 
70
  $count = 1;
56
  global $plugin_dir_name;
57
  $output .= '<div class="shopping_cart">';
58
  if (!get_option('wp_shopping_cart_image_hide')) {
59
+ $output .= "<img src='" . WP_CART_URL . "/images/shopping_cart_icon.png' class='wspsc_cart_header_image' value='" . (__("Cart", "WSPSC")) . "' title='" . (__("Cart", "WSPSC")) . "' />";
60
  }
61
  if (!empty($title)) {
62
  $output .= '<h2>';
64
  $output .= '</h2>';
65
  }
66
 
67
+ $output .= '<span id="pinfo" style="display: none; font-weight: bold; color: red;">' . (__("Hit enter to submit new Quantity.", "WSPSC")) . '</span>';
68
  $output .= '<table style="width: 100%;">';
69
 
70
  $count = 1;
paypal.php CHANGED
@@ -14,8 +14,8 @@ class paypal_ipn_handler {
14
  var $fields = array(); // array holds the fields to submit to paypal
15
  var $sandbox_mode = false;
16
 
17
- function paypal_ipn_handler()
18
- {
19
  $this->paypal_url = 'https://www.paypal.com/cgi-bin/webscr';
20
  $this->last_error = '';
21
  $this->ipn_log_file = WP_CART_PATH.'ipn_handle_debug.log';
@@ -131,7 +131,7 @@ class paypal_ipn_handler {
131
  $ip_address = $custom_values['ip'];
132
  $applied_coupon_code = $custom_values['coupon_code'];
133
  $currency_symbol = get_option('cart_currency_symbol');
134
- $this->debug_log('custom values',true);
135
  $this->debug_log_array($custom_values,true);
136
  $this->debug_log('Order post id: '.$post_id,true);
137
 
@@ -178,11 +178,12 @@ class paypal_ipn_handler {
178
 
179
  $orig_individual_item_total = round($orig_individual_item_total,2);
180
  $individual_paid_item_total = round($individual_paid_item_total,2);
181
- if($orig_individual_item_total < $individual_paid_item_total){
 
182
  $this->debug_log('Error! Post payment price validation failed. The price amount may have been altered. This transaction will not be processed.', false);
183
  $this->debug_log('Original total price: ' . $orig_individual_item_total . '. Paid total price: '.$individual_paid_item_total, false);
184
  return;
185
- }
186
  //*** End of security check ***
187
 
188
  $updated_wpsc_order = array(
14
  var $fields = array(); // array holds the fields to submit to paypal
15
  var $sandbox_mode = false;
16
 
17
+ function __construct()
18
+ {
19
  $this->paypal_url = 'https://www.paypal.com/cgi-bin/webscr';
20
  $this->last_error = '';
21
  $this->ipn_log_file = WP_CART_PATH.'ipn_handle_debug.log';
131
  $ip_address = $custom_values['ip'];
132
  $applied_coupon_code = $custom_values['coupon_code'];
133
  $currency_symbol = get_option('cart_currency_symbol');
134
+ $this->debug_log('Custom values',true);
135
  $this->debug_log_array($custom_values,true);
136
  $this->debug_log('Order post id: '.$post_id,true);
137
 
178
 
179
  $orig_individual_item_total = round($orig_individual_item_total,2);
180
  $individual_paid_item_total = round($individual_paid_item_total,2);
181
+ $this->debug_log('Checking price. Original price: ' . $orig_individual_item_total . '. Paid price: '.$individual_paid_item_total, true);
182
+ if($individual_paid_item_total < $orig_individual_item_total){ //Paid price is less so block this transaction.
183
  $this->debug_log('Error! Post payment price validation failed. The price amount may have been altered. This transaction will not be processed.', false);
184
  $this->debug_log('Original total price: ' . $orig_individual_item_total . '. Paid total price: '.$individual_paid_item_total, false);
185
  return;
186
+ }
187
  //*** End of security check ***
188
 
189
  $updated_wpsc_order = array(
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.tipsandtricks-hq.com
4
  Tags: cart, shopping cart, WordPress shopping cart, Paypal shopping cart, sell, selling, sell products, online shop, shop, e-commerce, wordpress ecommerce, wordpress store, store, PayPal cart widget, sell digital products, sell service, digital downloads, paypal, paypal cart, e-shop, compact cart, coupon, discount
5
  Requires at least: 3.0
6
  Tested up to: 4.3
7
- Stable tag: 4.1.0
8
  License: GPLv2 or later
9
 
10
  Very easy to use Simple WordPress Paypal Shopping Cart Plugin. Great for selling products online in one click from your WordPress site.
@@ -177,6 +177,21 @@ None
177
 
178
  == Changelog ==
179
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
180
  = 4.1.0 =
181
  - Removed "v" from the version number.
182
  - Added robust price validation checks.
4
  Tags: cart, shopping cart, WordPress shopping cart, Paypal shopping cart, sell, selling, sell products, online shop, shop, e-commerce, wordpress ecommerce, wordpress store, store, PayPal cart widget, sell digital products, sell service, digital downloads, paypal, paypal cart, e-shop, compact cart, coupon, discount
5
  Requires at least: 3.0
6
  Tested up to: 4.3
7
+ Stable tag: 4.1.3
8
  License: GPLv2 or later
9
 
10
  Very easy to use Simple WordPress Paypal Shopping Cart Plugin. Great for selling products online in one click from your WordPress site.
177
 
178
  == Changelog ==
179
 
180
+ = 4.1.3 =
181
+ - Updated the WP_Widget initialization to use PHP5 style constructor.
182
+ - There is a bug in WordPress 4.3 for the widgets which prevents the sidebar widget from working. WordPress 4.3.1 will fix this.
183
+ In the meantime you can use the following to show the shopping cart widget to the sidebar:
184
+ https://www.tipsandtricks-hq.com/ecommerce/adding-shopping-cart-to-the-sidebar-of-wordpress-site-3073
185
+
186
+ = 4.1.2 =
187
+ - Added a class to the cart header image element.
188
+ - Removed an extra <br> tag from the cart output.
189
+ - Plugin is now compatible with WordPress 4.3.
190
+ - Added another extra check to the price validation code.
191
+
192
+ = 4.1.1 =
193
+ - Updated constructor methods in classes with PHP 5 style constructors.
194
+
195
  = 4.1.0 =
196
  - Removed "v" from the version number.
197
  - Added robust price validation checks.
wp_shopping_cart.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: WP Simple Paypal Shopping cart
4
- Version: 4.1.0
5
  Plugin URI: https://www.tipsandtricks-hq.com/wordpress-simple-paypal-shopping-cart-plugin-768
6
  Author: Tips and Tricks HQ, Ruhul Amin
7
  Author URI: https://www.tipsandtricks-hq.com/
@@ -22,7 +22,7 @@ if (version_compare(PHP_VERSION, '5.4.0') >= 0) {
22
  }
23
  }
24
 
25
- define('WP_CART_VERSION', '4.1.0');
26
  define('WP_CART_FOLDER', dirname(plugin_basename(__FILE__)));
27
  define('WP_CART_PATH', plugin_dir_path(__FILE__));
28
  define('WP_CART_URL', plugins_url('', __FILE__));
@@ -578,8 +578,8 @@ function wp_paypal_shopping_cart_load_widgets() {
578
 
579
  class WP_PayPal_Cart_Widget extends WP_Widget {
580
 
581
- function WP_PayPal_Cart_Widget() {
582
- parent::WP_Widget('wp_paypal_shopping_cart_widgets', 'WP Paypal Shopping Cart', array('description' => 'WP Paypal Shopping Cart Widget'));
583
  }
584
 
585
  function form($instance) {
1
  <?php
2
  /*
3
  Plugin Name: WP Simple Paypal Shopping cart
4
+ Version: 4.1.3
5
  Plugin URI: https://www.tipsandtricks-hq.com/wordpress-simple-paypal-shopping-cart-plugin-768
6
  Author: Tips and Tricks HQ, Ruhul Amin
7
  Author URI: https://www.tipsandtricks-hq.com/
22
  }
23
  }
24
 
25
+ define('WP_CART_VERSION', '4.1.3');
26
  define('WP_CART_FOLDER', dirname(plugin_basename(__FILE__)));
27
  define('WP_CART_PATH', plugin_dir_path(__FILE__));
28
  define('WP_CART_URL', plugins_url('', __FILE__));
578
 
579
  class WP_PayPal_Cart_Widget extends WP_Widget {
580
 
581
+ function __construct() {
582
+ parent::__construct('wp_paypal_shopping_cart_widgets', 'WP Paypal Shopping Cart', array('description' => 'WP Paypal Shopping Cart Widget'));
583
  }
584
 
585
  function form($instance) {
wp_shopping_cart_misc_functions.php CHANGED
@@ -1,15 +1,6 @@
1
  <?php
2
 
3
- /* TODO
4
- - Create a dashbaord menu then complete the new menu system
5
- - Add a reset cart button
6
- - A stats addon or interface. Show graph using the orders data.
7
- - After processing an IPN, call a function to clear all trash orders that are older than 6 hours.
8
- - A new fancy cart shortcode (new icons and nice CSS styles)
9
- - Create github repository.
10
- */
11
-
12
- /* this function gets called when init is fired */
13
  function wp_cart_init_handler()
14
  {
15
  $orders_menu_permission = apply_filters('wspsc_orders_menu_permission', 'manage_options');
@@ -18,7 +9,7 @@ function wp_cart_init_handler()
18
  {
19
  wpspc_create_orders_page();
20
  }
21
- else//Init hook handing code for front end
22
  {
23
  wpspc_cart_actions_handler();
24
  add_filter('ngg_render_template','wp_cart_ngg_template_handler',10,2);
1
  <?php
2
 
3
+ /* This function gets called when init is executed */
 
 
 
 
 
 
 
 
 
4
  function wp_cart_init_handler()
5
  {
6
  $orders_menu_permission = apply_filters('wspsc_orders_menu_permission', 'manage_options');
9
  {
10
  wpspc_create_orders_page();
11
  }
12
+ else//Init hook handling code for front end
13
  {
14
  wpspc_cart_actions_handler();
15
  add_filter('ngg_render_template','wp_cart_ngg_template_handler',10,2);