WordPress Simple PayPal Shopping Cart - Version 4.3.3

Version Description

  • Fix for paypal adding "+" character between words in the item name parameter.
Download this release

Release Info

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

Code changes from version 4.3.0 to 4.3.3

includes/admin/wp_shopping_cart_menu_discounts.php CHANGED
@@ -57,7 +57,7 @@ function show_wp_cart_coupon_discount_settings_page()
57
<a href="https://www.tipsandtricks-hq.com/wordpress-simple-paypal-shopping-cart-plugin-768" target="_blank"><?php _e("WP Simple Cart Homepage", "wordpress-simple-paypal-shopping-cart"); ?></a></p>
58
</div>
59
60
- <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
61
<?php wp_nonce_field('wpspsc_coupon_settings'); ?>
62
<input type="hidden" name="coupon_settings_update" id="coupon_settings_update" value="true" />
63
@@ -90,7 +90,7 @@ function show_wp_cart_coupon_discount_settings_page()
90
</form>
91
</div></div>
92
93
- <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
94
<?php wp_nonce_field('wpspsc_save_coupon'); ?>
95
<input type="hidden" name="info_update" id="info_update" value="true" />
96
57
<a href="https://www.tipsandtricks-hq.com/wordpress-simple-paypal-shopping-cart-plugin-768" target="_blank"><?php _e("WP Simple Cart Homepage", "wordpress-simple-paypal-shopping-cart"); ?></a></p>
58
</div>
59
60
+ <form method="post" action="">
61
<?php wp_nonce_field('wpspsc_coupon_settings'); ?>
62
<input type="hidden" name="coupon_settings_update" id="coupon_settings_update" value="true" />
63
90
</form>
91
</div></div>
92
93
+ <form method="post" action="">
94
<?php wp_nonce_field('wpspsc_save_coupon'); ?>
95
<input type="hidden" name="info_update" id="info_update" value="true" />
96
includes/admin/wp_shopping_cart_menu_email_settings.php CHANGED
@@ -60,7 +60,7 @@ function show_wp_cart_email_settings_page()
60
<a href="https://www.tipsandtricks-hq.com/wordpress-simple-paypal-shopping-cart-plugin-768" target="_blank"><?php _e("WP Simple Cart Homepage", "wordpress-simple-paypal-shopping-cart"); ?></a></p>
61
</div>
62
63
- <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
64
<?php wp_nonce_field('wpspc_email_settings_update'); ?>
65
<input type="hidden" name="info_update" id="info_update" value="true" />
66
60
<a href="https://www.tipsandtricks-hq.com/wordpress-simple-paypal-shopping-cart-plugin-768" target="_blank"><?php _e("WP Simple Cart Homepage", "wordpress-simple-paypal-shopping-cart"); ?></a></p>
61
</div>
62
63
+ <form method="post" action="">
64
<?php wp_nonce_field('wpspc_email_settings_update'); ?>
65
<input type="hidden" name="info_update" id="info_update" value="true" />
66
includes/admin/wp_shopping_cart_menu_general_settings.php CHANGED
@@ -161,7 +161,7 @@ function show_wp_cart_options_page ()
161
<p><?php _e("Example shopping cart shortcode usage:", "wordpress-simple-paypal-shopping-cart");?> <p style="background-color: #DDDDDD; padding: 5px; display: inline;">[show_wp_shopping_cart]</p></p>
162
</div></div>
163
164
- <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
165
<?php wp_nonce_field('wp_simple_cart_settings_update'); ?>
166
<input type="hidden" name="info_update" id="info_update" value="true" />
167
<?php
161
<p><?php _e("Example shopping cart shortcode usage:", "wordpress-simple-paypal-shopping-cart");?> <p style="background-color: #DDDDDD; padding: 5px; display: inline;">[show_wp_shopping_cart]</p></p>
162
</div></div>
163
164
+ <form method="post" action="">
165
<?php wp_nonce_field('wp_simple_cart_settings_update'); ?>
166
<input type="hidden" name="info_update" id="info_update" value="true" />
167
<?php
paypal.php CHANGED
@@ -24,15 +24,19 @@ class paypal_ipn_handler {
24
25
function validate_and_dispatch_product()
26
{
27
- //Check Product Name, Price, Currency, Receivers email
28
$array_temp = $this->ipn_data;
29
$this->ipn_data = array_map('sanitize_text_field', $array_temp);
30
$txn_id = $this->ipn_data['txn_id'];
31
$transaction_type = $this->ipn_data['txn_type'];
32
$payment_status = $this->ipn_data['payment_status'];
33
- $transaction_subject = $this->ipn_data['transaction_subject'];
34
- $custom_value_str = $this->ipn_data['custom'];
35
- //$this->debug_log('custom values from paypal: '.$custom_value_str,true);
36
$first_name = $this->ipn_data['first_name'];
37
$last_name = $this->ipn_data['last_name'];
38
$buyer_email = $this->ipn_data['payer_email'];
@@ -42,8 +46,19 @@ class paypal_ipn_handler {
42
$zip = $this->ipn_data['address_zip'];
43
$country = $this->ipn_data['address_country'];
44
$phone = $this->ipn_data['contact_phone'];
45
- $address = $street_address.", ".$city.", ".$state.", ".$zip.", ".$country;
46
$custom_values = wp_cart_get_custom_var_array($custom_value_str);
47
$this->debug_log('Payment Status: '.$payment_status,true);
48
if($payment_status == "Completed" || $payment_status == "Processed" ){
49
//We will process this notification
@@ -64,7 +79,8 @@ class paypal_ipn_handler {
64
while($i < $num_cart_items+1)
65
{
66
$item_number = $this->ipn_data['item_number' . $i];
67
- $item_name = $this->ipn_data['item_name' . $i];
68
$quantity = $this->ipn_data['quantity' . $i];
69
$mc_gross = $this->ipn_data['mc_gross_' . $i];
70
$mc_currency = $this->ipn_data['mc_currency'];
@@ -86,7 +102,8 @@ class paypal_ipn_handler {
86
$cart_items = array();
87
$this->debug_log('Transaction Type: Buy Now',true);
88
$item_number = $this->ipn_data['item_number'];
89
- $item_name = $this->ipn_data['item_name'];
90
$quantity = $this->ipn_data['quantity'];
91
$mc_gross = $this->ipn_data['mc_gross'];
92
$mc_currency = $this->ipn_data['mc_currency'];
24
25
function validate_and_dispatch_product()
26
{
27
+ //Check Product Name, Price, Currency, Receiver email
28
+
29
+ //Decode the custom field before sanitizing.
30
+ $custom_field_value = urldecode($this->ipn_data['custom']);//urldecode is harmless
31
+ $this->ipn_data['custom'] = $custom_field_value;
32
+
33
+ //Sanitize and read data.
34
$array_temp = $this->ipn_data;
35
$this->ipn_data = array_map('sanitize_text_field', $array_temp);
36
$txn_id = $this->ipn_data['txn_id'];
37
$transaction_type = $this->ipn_data['txn_type'];
38
$payment_status = $this->ipn_data['payment_status'];
39
+ $transaction_subject = $this->ipn_data['transaction_subject'];
40
$first_name = $this->ipn_data['first_name'];
41
$last_name = $this->ipn_data['last_name'];
42
$buyer_email = $this->ipn_data['payer_email'];
46
$zip = $this->ipn_data['address_zip'];
47
$country = $this->ipn_data['address_country'];
48
$phone = $this->ipn_data['contact_phone'];
49
+
50
+ if(empty($street_address) && empty($city)){
51
+ //No address value present
52
+ $address = "";
53
+ } else {
54
+ //An address value is present
55
+ $address = $street_address.", ".$city.", ".$state.", ".$zip.", ".$country;
56
+ }
57
+
58
+ $custom_value_str = $this->ipn_data['custom'];
59
+ $this->debug_log('Custom field value in the IPN: '.$custom_value_str, true);
60
$custom_values = wp_cart_get_custom_var_array($custom_value_str);
61
+
62
$this->debug_log('Payment Status: '.$payment_status,true);
63
if($payment_status == "Completed" || $payment_status == "Processed" ){
64
//We will process this notification
79
while($i < $num_cart_items+1)
80
{
81
$item_number = $this->ipn_data['item_number' . $i];
82
+ $item_name = urldecode($this->ipn_data['item_name' . $i]);
83
+ $this->ipn_data['item_name' . $i] = $item_name;
84
$quantity = $this->ipn_data['quantity' . $i];
85
$mc_gross = $this->ipn_data['mc_gross_' . $i];
86
$mc_currency = $this->ipn_data['mc_currency'];
102
$cart_items = array();
103
$this->debug_log('Transaction Type: Buy Now',true);
104
$item_number = $this->ipn_data['item_number'];
105
+ $item_name = urldecode($this->ipn_data['item_name']);
106
+ $this->ipn_data['item_name'] = $item_name;
107
$quantity = $this->ipn_data['quantity'];
108
$mc_gross = $this->ipn_data['mc_gross'];
109
$mc_currency = $this->ipn_data['mc_currency'];
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.7
7
- Stable tag: 4.3.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.
@@ -151,25 +151,31 @@ example usage: [wp_cart_button name="Test Product" price="29.95" var1="Size|smal
151
4. Use the trigger text to add a product to a post or page where you want it to appear.
152
153
== Frequently Asked Questions ==
154
- 1. Can this plugin be used to accept paypal payment for a service or a product? Yes
155
- 2. Does this plugin have shopping cart? Yes.
156
- 3. Can the shopping cart be added to a checkout page? Yes.
157
- 4. Does this plugin has multiple currency support? Yes.
158
- 5. Is the 'Add to Cart' button customizable? Yes.
159
- 6. Does this plugin use a return URL to redirect customers to a specified page after Paypal has processed the payment? Yes.
160
- 7. How can I add a buy button on the sidebar widget of my site?
161
Check the documentation on [how to add buy buttons to the sidebar](https://www.tipsandtricks-hq.com/ecommerce/wordpress-shopping-cart-additional-resources-322#add_button_in_sidebar)
162
- 8. Can I use this plugin to sell digital downloads?
163
- Yes. See the [digital download usage documentation] (https://www.tipsandtricks-hq.com/ecommerce/wp-simple-cart-sell-digital-downloads-2468)
164
- 9. Can I configure discount coupon with this shopping cart plugin?
165
Yes. you can setup discount coupons from the "Coupon/Discount" interface of the plugin.
166
- 10. Can I configure product sale notification so I get notified when a sale is made?
167
Yes. You can configure sale notification from the "Email Settings" interface of the plugin.
168
- 11. Can I modify the product box thumbnail image?
169
Yes.
170
- 12. Can I customize the format of the price display?
171
Yes.
172
- 13. Can the customers be sent to a cancel URL when they click "cancel" from the PayPal checkout page?
173
Yes.
174
175
== Screenshots ==
@@ -181,6 +187,15 @@ None
181
182
== Changelog ==
183
184
= 4.3.0 =
185
- Added Brazilian Portuguese Language translation to the plugin. The translation file was submitted by Fabio Goncalves.
186
- If the total shipping cost in the cart is 0 then the plugin will send a flag to paypal to not prompt for shipping address during checkout.
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.7
7
+ Stable tag: 4.3.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.
151
4. Use the trigger text to add a product to a post or page where you want it to appear.
152
153
== Frequently Asked Questions ==
154
+ = Can this plugin be used to accept paypal payment for a service or a product? =
155
+ Yes
156
+ = Does this plugin have shopping cart =
157
+ Yes
158
+ = Can the shopping cart be added to a checkout page? =
159
+ Yes
160
+ = Does this plugin has multiple currency support? =
161
+ Yes
162
+ = Is the 'Add to Cart' button customizable? =
163
+ Yes
164
+ = Does this plugin use a return URL to redirect customers to a specified page after Paypal has processed the payment? =
165
+ Yes
166
+ = How can I add a buy button on the sidebar widget of my site? =
167
Check the documentation on [how to add buy buttons to the sidebar](https://www.tipsandtricks-hq.com/ecommerce/wordpress-shopping-cart-additional-resources-322#add_button_in_sidebar)
168
+ = Can I use this plugin to sell digital downloads? =
169
+ Yes. See the [digital download usage documentation](https://www.tipsandtricks-hq.com/ecommerce/wp-simple-cart-sell-digital-downloads-2468)
170
+ = Can I configure discount coupon with this shopping cart plugin? =
171
Yes. you can setup discount coupons from the "Coupon/Discount" interface of the plugin.
172
+ = Can I configure product sale notification so I get notified when a sale is made? =
173
Yes. You can configure sale notification from the "Email Settings" interface of the plugin.
174
+ = Can I modify the product box thumbnail image? =
175
Yes.
176
+ = Can I customize the format of the price display? =
177
Yes.
178
+ = Can the customers be sent to a cancel URL when they click "cancel" from the PayPal checkout page? =
179
Yes.
180
181
== Screenshots ==
187
188
== Changelog ==
189
190
+ = 4.3.3 =
191
+ - Fix for paypal adding "+" character between words in the item name parameter.
192
+
193
+ = 4.3.2 =
194
+ - Bugfix for the new custom field change.
195
+
196
+ = 4.3.1 =
197
+ - Custom field values will now be urlencoded.
198
+
199
= 4.3.0 =
200
- Added Brazilian Portuguese Language translation to the plugin. The translation file was submitted by Fabio Goncalves.
201
- If the total shipping cost in the cart is 0 then the plugin will send a flag to paypal to not prompt for shipping address during checkout.
wp_shopping_cart.php CHANGED
@@ -1,7 +1,7 @@
1
<?php
2
/*
3
Plugin Name: WP Simple Paypal Shopping cart
4
- Version: 4.3.0
5
Plugin URI: https://www.tipsandtricks-hq.com/wordpress-simple-paypal-shopping-cart-plugin-768
6
Author: Tips and Tricks HQ, Ruhul Amin, mra13
7
Author URI: https://www.tipsandtricks-hq.com/
@@ -26,7 +26,7 @@ if (version_compare(PHP_VERSION, '5.4.0') >= 0) {
26
}
27
}
28
29
- define('WP_CART_VERSION', '4.3.0');
30
define('WP_CART_FOLDER', dirname(plugin_basename(__FILE__)));
31
define('WP_CART_PATH', plugin_dir_path(__FILE__));
32
define('WP_CART_URL', plugins_url('', __FILE__));
@@ -335,6 +335,7 @@ function wp_cart_add_custom_field() {
335
}
336
337
$custom_field_val = apply_filters('wpspc_cart_custom_field_value', $custom_field_val);
338
$output = '<input type="hidden" name="custom" value="' . $custom_field_val . '" />';
339
return $output;
340
}
1
<?php
2
/*
3
Plugin Name: WP Simple Paypal Shopping cart
4
+ Version: 4.3.3
5
Plugin URI: https://www.tipsandtricks-hq.com/wordpress-simple-paypal-shopping-cart-plugin-768
6
Author: Tips and Tricks HQ, Ruhul Amin, mra13
7
Author URI: https://www.tipsandtricks-hq.com/
26
}
27
}
28
29
+ define('WP_CART_VERSION', '4.3.2');
30
define('WP_CART_FOLDER', dirname(plugin_basename(__FILE__)));
31
define('WP_CART_PATH', plugin_dir_path(__FILE__));
32
define('WP_CART_URL', plugins_url('', __FILE__));
335
}
336
337
$custom_field_val = apply_filters('wpspc_cart_custom_field_value', $custom_field_val);
338
+ $custom_field_val = urlencode($custom_field_val);//URL encode the custom field value so nothing gets lost when it is passed around.
339
$output = '<input type="hidden" name="custom" value="' . $custom_field_val . '" />';
340
return $output;
341
}
wp_shopping_cart_orders.php CHANGED
@@ -100,11 +100,22 @@ function wpspc_order_review_meta_box($wpsc_cart_orders)
100
</tr>
101
<tr>
102
<td><?php _e("Address", "wordpress-simple-paypal-shopping-cart");?></td>
103
- <td><textarea name="wpsc_address" cols="83" rows="2"><?php echo esc_attr($address);?></textarea></td>
104
</tr>
105
<tr>
106
<td><?php _e("Phone", "wordpress-simple-paypal-shopping-cart");?></td>
107
- <td><input type="text" size="40" name="wpspsc_phone" value="<?php echo esc_attr($phone); ?>" /></td>
108
</tr>
109
<tr>
110
<td><?php _e("Buyer Email Sent?", "wordpress-simple-paypal-shopping-cart");?></td>
100
</tr>
101
<tr>
102
<td><?php _e("Address", "wordpress-simple-paypal-shopping-cart");?></td>
103
+ <td>
104
+ <textarea name="wpsc_address" cols="83" rows="2"><?php echo esc_attr($address);?></textarea>
105
+ <p class="description">
106
+ <?php _e("An address value will only be present if the order has physical item(s) with shipping amount. ", "wordpress-simple-paypal-shopping-cart"); ?>
107
+ <?php _e("If you want to collect address for all orders then enable the 'Must Collect Shipping Address on PayPal' option from the plugin settings.", "wordpress-simple-paypal-shopping-cart"); ?>
108
+ </p>
109
+ </td>
110
</tr>
111
<tr>
112
<td><?php _e("Phone", "wordpress-simple-paypal-shopping-cart");?></td>
113
+ <td>
114
+ <input type="text" size="40" name="wpspsc_phone" value="<?php echo esc_attr($phone); ?>" />
115
+ <p class="description">
116
+ <?php _e("A phone number will only be present if the customer entered one during the checkout.", "wordpress-simple-paypal-shopping-cart"); ?>
117
+ </p>
118
+ </td>
119
</tr>
120
<tr>
121
<td><?php _e("Buyer Email Sent?", "wordpress-simple-paypal-shopping-cart");?></td>