Razorpay for WooCommerce - Version 3.3.0

Version Description

  • Magic checkout COD intelligence config moved from wooc dashboard to razorpay dashboard.
Download this release

Release Info

Developer razorpay
Plugin Icon 128x128 Razorpay for WooCommerce
Version 3.3.0
Comparing to
See all releases

Code changes from version 3.2.2 to 3.3.0

includes/api/api.php CHANGED
@@ -172,13 +172,6 @@ function addMagicCheckoutSettingFields(&$defaultFormFields)
172
  'label' => __('Activate Mandatory Login for Magic Checkout'),
173
  'default' => 'no',
174
  ),
175
- 'enable_1cc_cod_intelligence' => array(
176
- 'title' => __('Activate COD Intelligence'),
177
- 'type' => 'checkbox',
178
- 'description' => "By enabling this you allow Magic Checkout to decide which customer sees the COD option based on past shopping history",
179
- 'label' => __('Activate Magic Checkout COD Intelligence'),
180
- 'default' => 'no',
181
- ),
182
  '1cc_min_COD_slab_amount' => array(
183
  'title' => __('Set minimum amount (INR) for COD'),
184
  'type' => 'number',
172
  'label' => __('Activate Mandatory Login for Magic Checkout'),
173
  'default' => 'no',
174
  ),
 
 
 
 
 
 
 
175
  '1cc_min_COD_slab_amount' => array(
176
  'title' => __('Set minimum amount (INR) for COD'),
177
  'type' => 'number',
includes/api/coupon-apply.php CHANGED
@@ -58,7 +58,7 @@ function applyCouponOnCart(WP_REST_Request $request)
58
 
59
  return new WP_REST_Response($response, 400);
60
  }
61
-
62
  //check woo-discount-rule plugin disabling the coupons
63
  if (is_plugin_active('woo-discount-rules/woo-discount-rules.php')) {
64
  $discountOptions = get_option('woo-discount-config-v2', []);
58
 
59
  return new WP_REST_Response($response, 400);
60
  }
61
+
62
  //check woo-discount-rule plugin disabling the coupons
63
  if (is_plugin_active('woo-discount-rules/woo-discount-rules.php')) {
64
  $discountOptions = get_option('woo-discount-config-v2', []);
includes/api/order.php CHANGED
@@ -118,13 +118,12 @@ function createWcOrder(WP_REST_Request $request)
118
 
119
  // To remove coupon added on order.
120
  $coupons = $order->get_used_coupons();
121
- if(!empty($coupons)){
122
- foreach($coupons as $coupon){
123
  $order->remove_coupon($coupon);
124
  }
125
  $couponCode = $coupons[0];
126
  }
127
-
128
 
129
  //To remove by default shipping method added on order.
130
  $items = (array) $order->get_items('shipping');
@@ -220,11 +219,6 @@ function createWcOrder(WP_REST_Request $request)
220
  $response['customer_cart'] = $customer_cart ?? '';
221
  }
222
 
223
- if (empty(get_option('woocommerce_razorpay_settings')['enable_1cc_cod_intelligence']) === true
224
- || get_option('woocommerce_razorpay_settings')['enable_1cc_cod_intelligence'] != 'yes') {
225
- $response['force_cod'] = true;
226
- }
227
-
228
  $woocommerce->session->set(RZP_1CC_CART_HASH . $cartHash, $orderId);
229
  set_transient(RZP_1CC_CART_HASH . $orderId, $cartHash, 3600);
230
  set_transient($razorpay::SESSION_KEY, $orderId, 3600);
118
 
119
  // To remove coupon added on order.
120
  $coupons = $order->get_used_coupons();
121
+ if (!empty($coupons)) {
122
+ foreach ($coupons as $coupon) {
123
  $order->remove_coupon($coupon);
124
  }
125
  $couponCode = $coupons[0];
126
  }
 
127
 
128
  //To remove by default shipping method added on order.
129
  $items = (array) $order->get_items('shipping');
219
  $response['customer_cart'] = $customer_cart ?? '';
220
  }
221
 
 
 
 
 
 
222
  $woocommerce->session->set(RZP_1CC_CART_HASH . $cartHash, $orderId);
223
  set_transient(RZP_1CC_CART_HASH . $orderId, $cartHash, 3600);
224
  set_transient($razorpay::SESSION_KEY, $orderId, 3600);
includes/api/shipping-info.php CHANGED
@@ -332,7 +332,7 @@ function smartCodRestriction($addresses, $order)
332
  {
333
  $restriction = get_option('woocommerce_cod_settings');
334
  $restrictionSettings = json_decode($restriction['restriction_settings']);
335
-
336
  $items = WC()->cart->get_cart();
337
 
338
  $products = [];
332
  {
333
  $restriction = get_option('woocommerce_cod_settings');
334
  $restrictionSettings = json_decode($restriction['restriction_settings']);
335
+
336
  $items = WC()->cart->get_cart();
337
 
338
  $products = [];
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: razorpay
3
  Tags: razorpay, payments, india, woocommerce, ecommerce
4
  Requires at least: 3.9.2
5
  Tested up to: 5.9
6
- Stable tag: 3.2.2
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -41,6 +41,9 @@ This is compatible with WooCommerce>=2.4, including the new 3.0 release. It has
41
 
42
  == Changelog ==
43
 
 
 
 
44
  = 3.2.2 =
45
  * Bug fix in admin config page for magic checkout
46
 
3
  Tags: razorpay, payments, india, woocommerce, ecommerce
4
  Requires at least: 3.9.2
5
  Tested up to: 5.9
6
+ Stable tag: 3.3.0
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
41
 
42
  == Changelog ==
43
 
44
+ = 3.3.0 =
45
+ * Magic checkout COD intelligence config moved from wooc dashboard to razorpay dashboard.
46
+
47
  = 3.2.2 =
48
  * Bug fix in admin config page for magic checkout
49
 
woo-razorpay.php CHANGED
@@ -3,8 +3,8 @@
3
  * Plugin Name: Razorpay for WooCommerce
4
  * Plugin URI: https://razorpay.com
5
  * Description: Razorpay Payment Gateway Integration for WooCommerce
6
- * Version: 3.2.2
7
- * Stable tag: 3.2.2
8
  * Author: Team Razorpay
9
  * WC tested up to: 6.2.2
10
  * Author URI: https://razorpay.com
@@ -174,7 +174,6 @@ function woocommerce_razorpay_init()
174
  $this->visibleSettings = array_merge($this->visibleSettings, array(
175
  'enable_1cc',
176
  'enable_1cc_mandatory_login',
177
- 'enable_1cc_cod_intelligence',
178
  'enable_1cc_test_mode',
179
  'enable_1cc_debug_mode',
180
  'enable_1cc_pdp_checkout',
3
  * Plugin Name: Razorpay for WooCommerce
4
  * Plugin URI: https://razorpay.com
5
  * Description: Razorpay Payment Gateway Integration for WooCommerce
6
+ * Version: 3.3.0
7
+ * Stable tag: 3.3.0
8
  * Author: Team Razorpay
9
  * WC tested up to: 6.2.2
10
  * Author URI: https://razorpay.com
174
  $this->visibleSettings = array_merge($this->visibleSettings, array(
175
  'enable_1cc',
176
  'enable_1cc_mandatory_login',
 
177
  'enable_1cc_test_mode',
178
  'enable_1cc_debug_mode',
179
  'enable_1cc_pdp_checkout',