WordPress Simple PayPal Shopping Cart - Version 3.8.7

Version Description

  • Changed a few function names and made them unique to reduce the chance of a function name conflict with another plugin.
  • Added a new option in the plugin so the purchased items of a transaction will be shown under orders menu
  • Payment notification will only be processed when the status is completed.
Download this release

Release Info

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

Code changes from version 3.8.6 to 3.8.7

images/index.html ADDED
File without changes
index.html ADDED
File without changes
lib/index.html ADDED
File without changes
paypal.php CHANGED
@@ -26,6 +26,7 @@ class paypal_ipn_handler {
26
  global $products,$currency,$paypal_email;
27
  $txn_id = $this->ipn_data['txn_id'];
28
  $transaction_type = $this->ipn_data['txn_type'];
 
29
  $transaction_subject = $this->ipn_data['transaction_subject'];
30
  $custom_value_str = $this->ipn_data['custom'];
31
  //$this->debug_log('custom values from paypal: '.$custom_value_str,true);
@@ -39,7 +40,14 @@ class paypal_ipn_handler {
39
  $country = $this->ipn_data['address_country'];
40
  $address = $street_address.", ".$city.", ".$state.", ".$zip.", ".$country;
41
  $custom_values = wp_cart_get_custom_var_array($custom_value_str);
42
-
 
 
 
 
 
 
 
43
  if ($transaction_type == "cart")
44
  {
45
  $this->debug_log('Transaction Type: Shopping Cart',true);
@@ -164,12 +172,12 @@ class paypal_ipn_handler {
164
  }
165
  $args = array();
166
  $args['product_details'] = $product_details;
 
167
  $from_email = get_option('wpspc_buyer_from_email');
168
  $subject = get_option('wpspc_buyer_email_subj');
169
  $body = get_option('wpspc_buyer_email_body');
170
  $args['email_body'] = $body;
171
  $body = wpspc_apply_dynamic_tags_on_email_body($this->ipn_data, $args);
172
-
173
  if($buyer_email){
174
  if(get_option('wpspc_send_buyer_email'))
175
  {
26
  global $products,$currency,$paypal_email;
27
  $txn_id = $this->ipn_data['txn_id'];
28
  $transaction_type = $this->ipn_data['txn_type'];
29
+ $payment_status = $this->ipn_data['payment_status'];
30
  $transaction_subject = $this->ipn_data['transaction_subject'];
31
  $custom_value_str = $this->ipn_data['custom'];
32
  //$this->debug_log('custom values from paypal: '.$custom_value_str,true);
40
  $country = $this->ipn_data['address_country'];
41
  $address = $street_address.", ".$city.", ".$state.", ".$zip.", ".$country;
42
  $custom_values = wp_cart_get_custom_var_array($custom_value_str);
43
+ $this->debug_log('Payment Status: '.$payment_status,true);
44
+ if($payment_status == "Completed" || $payment_status == "Processed" ){
45
+ //We will process this notification
46
+ }
47
+ else{
48
+ $this->debug_log('This is not a payment complete notification. This IPN will not be processed.',true);
49
+ return true;
50
+ }
51
  if ($transaction_type == "cart")
52
  {
53
  $this->debug_log('Transaction Type: Shopping Cart',true);
172
  }
173
  $args = array();
174
  $args['product_details'] = $product_details;
175
+ update_post_meta($post_id, 'wpspsc_items_ordered', $product_details);
176
  $from_email = get_option('wpspc_buyer_from_email');
177
  $subject = get_option('wpspc_buyer_email_subj');
178
  $body = get_option('wpspc_buyer_email_body');
179
  $args['email_body'] = $body;
180
  $body = wpspc_apply_dynamic_tags_on_email_body($this->ipn_data, $args);
 
181
  if($buyer_email){
182
  if(get_option('wpspc_send_buyer_email'))
183
  {
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === WordPress Simple Paypal Shopping Cart ===
2
  Contributors: Ruhul Amin, Tips and Tricks HQ
3
  Donate link: http://www.tipsandtricks-hq.com
4
- Tags: cart, shopping cart, WordPress shopping cart, Paypal shopping cart, sell products, online shop, shop, e-commerce, wordpress ecommerce, wordpress store, store, PayPal cart widget, sell digital products, digital downloads, paypal, paypal cart, e-shop,
5
  Requires at least: 3.0
6
  Tested up to: 3.6.1
7
- Stable tag: 3.8.6
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.
@@ -118,6 +118,12 @@ Visit the plugin site at http://www.tipsandtricks-hq.com/?p=768 for screenshots.
118
  None
119
 
120
  == Changelog ==
 
 
 
 
 
 
121
  = 3.8.6 =
122
  - Updated the broken settings menu link
123
  - Updated the NextGen gallery integration to return $arg1 rather than $arg2
@@ -126,9 +132,9 @@ None
126
  - Added an email settings menu where the site admin can customize the buyer email that gets sent after a transaction
127
  - Also, added the following dynamic email tags for the email body field:
128
 
129
- {first_name} First name of the buyer
130
- {last_name} Last name of the buyer
131
- {product_details} The item details of the purchased product (this will include the download link for digital items).
132
 
133
  = 3.8.4 =
134
  - Fixing an issue that resulted from doing a commit when wordpress.org plugin repository was undergoing maintenance
1
  === WordPress Simple Paypal Shopping Cart ===
2
  Contributors: Ruhul Amin, Tips and Tricks HQ
3
  Donate link: http://www.tipsandtricks-hq.com
4
+ Tags: cart, shopping cart, WordPress shopping cart, Paypal shopping cart, sell products, online shop, shop, e-commerce, wordpress ecommerce, wordpress store, store, PayPal cart widget, sell digital products, digital downloads, paypal, paypal cart, e-shop
5
  Requires at least: 3.0
6
  Tested up to: 3.6.1
7
+ Stable tag: 3.8.7
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.
118
  None
119
 
120
  == Changelog ==
121
+
122
+ = 3.8.7 =
123
+ - Changed a few function names and made them unique to reduce the chance of a function name conflict with another plugin.
124
+ - Added a new option in the plugin so the purchased items of a transaction will be shown under orders menu
125
+ - Payment notification will only be processed when the status is completed.
126
+
127
  = 3.8.6 =
128
  - Updated the broken settings menu link
129
  - Updated the NextGen gallery integration to return $arg1 rather than $arg2
132
  - Added an email settings menu where the site admin can customize the buyer email that gets sent after a transaction
133
  - Also, added the following dynamic email tags for the email body field:
134
 
135
+ {first_name} First name of the buyer
136
+ {last_name} Last name of the buyer
137
+ {product_details} The item details of the purchased product (this will include the download link for digital items).
138
 
139
  = 3.8.4 =
140
  - Fixing an issue that resulted from doing a commit when wordpress.org plugin repository was undergoing maintenance
wp_shopping_cart.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: WP Simple Paypal Shopping cart
4
- Version: v3.8.6
5
  Plugin URI: http://www.tipsandtricks-hq.com/?p=768
6
  Author: Ruhul Amin
7
  Author URI: http://www.tipsandtricks-hq.com/
@@ -12,7 +12,7 @@ if(!isset($_SESSION)){
12
  session_start();
13
  }
14
 
15
- define('WP_CART_VERSION', '3.8.6');
16
  define('WP_CART_FOLDER', dirname(plugin_basename(__FILE__)));
17
  define('WP_CART_PATH',plugin_dir_path( __FILE__ ));
18
  define('WP_CART_URL', plugins_url('',__FILE__));
1
  <?php
2
  /*
3
  Plugin Name: WP Simple Paypal Shopping cart
4
+ Version: v3.8.7
5
  Plugin URI: http://www.tipsandtricks-hq.com/?p=768
6
  Author: Ruhul Amin
7
  Author URI: http://www.tipsandtricks-hq.com/
12
  session_start();
13
  }
14
 
15
+ define('WP_CART_VERSION', '3.8.7');
16
  define('WP_CART_FOLDER', dirname(plugin_basename(__FILE__)));
17
  define('WP_CART_PATH',plugin_dir_path( __FILE__ ));
18
  define('WP_CART_URL', plugins_url('',__FILE__));
wp_shopping_cart_misc_functions.php CHANGED
@@ -1,6 +1,9 @@
1
  <?php
2
 
3
  /* TODO
 
 
 
4
  - Simple discount coupons option (see the user submitted coupon code version and incorporate that in here)
5
  - Mention the available languages
6
  */
@@ -11,7 +14,7 @@ function wp_cart_init_handler()
11
  //Add any common init hook handing code
12
  if(is_admin())//Init hook handing code for wp-admin
13
  {
14
- wpc_create_orders_page();
15
  }
16
  else//Init hook handing code for front end
17
  {
@@ -28,7 +31,7 @@ function wp_cart_init_handler()
28
 
29
  function wp_cart_admin_init_handler()
30
  {
31
- wpsc_add_meta_boxes();
32
  }
33
 
34
  function wpc_append_values_to_custom_field($name,$value)
1
  <?php
2
 
3
  /* TODO
4
+ - Change some of the INPUT name to make it more unique - http://wordpress.org/support/topic/checkout-functions-return-404-error-all-of-the-sudden
5
+ - add a "button_image" parameter in the shortcode to customize the add to cart button
6
+ - add an option for the admin email notification.
7
  - Simple discount coupons option (see the user submitted coupon code version and incorporate that in here)
8
  - Mention the available languages
9
  */
14
  //Add any common init hook handing code
15
  if(is_admin())//Init hook handing code for wp-admin
16
  {
17
+ wpspc_create_orders_page();
18
  }
19
  else//Init hook handing code for front end
20
  {
31
 
32
  function wp_cart_admin_init_handler()
33
  {
34
+ wpspc_add_meta_boxes();
35
  }
36
 
37
  function wpc_append_values_to_custom_field($name,$value)
wp_shopping_cart_orders.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
 
3
- add_action( 'save_post', 'wpsc_cart_save_orders', 10, 2 );
4
 
5
- function wpc_create_orders_page()
6
  {
7
  register_post_type( 'wpsc_cart_orders',
8
  array(
@@ -32,18 +32,18 @@ function wpc_create_orders_page()
32
  );
33
  }
34
 
35
- function wpsc_add_meta_boxes()
36
  {
37
  add_meta_box( 'order_review_meta_box',
38
  'Order Review',
39
- 'wpsc_order_review_meta_box',
40
  'wpsc_cart_orders',
41
  'normal',
42
  'high'
43
  );
44
  }
45
 
46
- function wpsc_order_review_meta_box($wpsc_cart_orders)
47
  {
48
  // Retrieve current name of the Director and Movie Rating based on review ID
49
  $order_id = $wpsc_cart_orders->ID;
@@ -60,6 +60,8 @@ function wpsc_order_review_meta_box($wpsc_cart_orders)
60
  if(!empty($email_sent_value)){
61
  $email_sent_field_msg = "Yes. ".$email_sent_value;
62
  }
 
 
63
  ?>
64
  <table>
65
  <p>Order ID: #<?php echo $order_id;?></p>
@@ -93,13 +95,17 @@ function wpsc_order_review_meta_box($wpsc_cart_orders)
93
  <tr>
94
  <td>Buyer Email Sent?</td>
95
  <td><input type="text" size="80" name="wpsc_buyer_email_sent" value="<?php echo $email_sent_field_msg; ?>" readonly /></td>
96
- </tr>
 
 
 
 
97
 
98
  </table>
99
  <?php
100
  }
101
 
102
- function wpsc_cart_save_orders( $order_id, $wpsc_cart_orders ) {
103
  // Check post type for movie reviews
104
  if ( $wpsc_cart_orders->post_type == 'wpsc_cart_orders' ) {
105
  // Store data in post meta table if present in post data
@@ -121,11 +127,14 @@ function wpsc_cart_save_orders( $order_id, $wpsc_cart_orders ) {
121
  if ( isset( $_POST['wpsc_address'] ) && $_POST['wpsc_address'] != '' ) {
122
  update_post_meta( $order_id, 'wpsc_address', $_POST['wpsc_address'] );
123
  }
 
 
 
124
  }
125
  }
126
 
127
- add_filter( 'manage_edit-wpsc_cart_orders_columns', 'wpsc_orders_display_columns' );
128
- function wpsc_orders_display_columns( $columns )
129
  {
130
  //unset( $columns['title'] );
131
  unset( $columns['comments'] );
@@ -142,8 +151,8 @@ function wpsc_orders_display_columns( $columns )
142
  }
143
 
144
  //add_action( 'manage_posts_custom_column', 'wpsc_populate_order_columns' , 10, 2);
145
- add_action('manage_wpsc_cart_orders_posts_custom_column', 'wpsc_populate_order_columns', 10, 2);
146
- function wpsc_populate_order_columns($column, $post_id)
147
  {
148
  if ( 'wpsc_first_name' == $column ) {
149
  $ip_address = get_post_meta( $post_id, 'wpsc_first_name', true );
1
  <?php
2
 
3
+ add_action( 'save_post', 'wpspc_cart_save_orders', 10, 2 );
4
 
5
+ function wpspc_create_orders_page()
6
  {
7
  register_post_type( 'wpsc_cart_orders',
8
  array(
32
  );
33
  }
34
 
35
+ function wpspc_add_meta_boxes()
36
  {
37
  add_meta_box( 'order_review_meta_box',
38
  'Order Review',
39
+ 'wpspc_order_review_meta_box',
40
  'wpsc_cart_orders',
41
  'normal',
42
  'high'
43
  );
44
  }
45
 
46
+ function wpspc_order_review_meta_box($wpsc_cart_orders)
47
  {
48
  // Retrieve current name of the Director and Movie Rating based on review ID
49
  $order_id = $wpsc_cart_orders->ID;
60
  if(!empty($email_sent_value)){
61
  $email_sent_field_msg = "Yes. ".$email_sent_value;
62
  }
63
+
64
+ $items_ordered = get_post_meta( $wpsc_cart_orders->ID, 'wpspsc_items_ordered', true );
65
  ?>
66
  <table>
67
  <p>Order ID: #<?php echo $order_id;?></p>
95
  <tr>
96
  <td>Buyer Email Sent?</td>
97
  <td><input type="text" size="80" name="wpsc_buyer_email_sent" value="<?php echo $email_sent_field_msg; ?>" readonly /></td>
98
+ </tr>
99
+ <tr>
100
+ <td>Item(s) Ordered:</td>
101
+ <td><textarea name="wpspsc_items_ordered" cols="83" rows="5"><?php echo $items_ordered;?></textarea></td>
102
+ </tr>
103
 
104
  </table>
105
  <?php
106
  }
107
 
108
+ function wpspc_cart_save_orders( $order_id, $wpsc_cart_orders ) {
109
  // Check post type for movie reviews
110
  if ( $wpsc_cart_orders->post_type == 'wpsc_cart_orders' ) {
111
  // Store data in post meta table if present in post data
127
  if ( isset( $_POST['wpsc_address'] ) && $_POST['wpsc_address'] != '' ) {
128
  update_post_meta( $order_id, 'wpsc_address', $_POST['wpsc_address'] );
129
  }
130
+ if ( isset( $_POST['wpspsc_items_ordered'] ) && $_POST['wpspsc_items_ordered'] != '' ) {
131
+ update_post_meta( $order_id, 'wpspsc_items_ordered', $_POST['wpspsc_items_ordered'] );
132
+ }
133
  }
134
  }
135
 
136
+ add_filter( 'manage_edit-wpsc_cart_orders_columns', 'wpspc_orders_display_columns' );
137
+ function wpspc_orders_display_columns( $columns )
138
  {
139
  //unset( $columns['title'] );
140
  unset( $columns['comments'] );
151
  }
152
 
153
  //add_action( 'manage_posts_custom_column', 'wpsc_populate_order_columns' , 10, 2);
154
+ add_action('manage_wpsc_cart_orders_posts_custom_column', 'wpspc_populate_order_columns', 10, 2);
155
+ function wpspc_populate_order_columns($column, $post_id)
156
  {
157
  if ( 'wpsc_first_name' == $column ) {
158
  $ip_address = get_post_meta( $post_id, 'wpsc_first_name', true );