Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 9c3f675

Browse files
Merge pull request #466 from woocommerce/fix/fatal-error-spb
Fix issue by triggering code only on front-end
2 parents 1000005 + c9caded commit 9c3f675

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
*** Changelog ***
22

3+
= 1.6.3 - 2018-08-15 =
4+
* Fix - Fatal error caused by a fix for Smart Payment Buttons.
5+
36
= 1.6.2 - 2018-08-15 =
47
* Fix - Tax not applied on the (Confirm your PayPal order) page at the checkout.
58

includes/class-wc-gateway-ppec-cart-handler.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,12 @@ public function enqueue_scripts() {
376376
* Creates a customer session if one is not already active.
377377
*/
378378
public function ensure_session() {
379+
$frontend = ( ! is_admin() || defined( 'DOING_AJAX' ) ) && ! defined( 'DOING_CRON' ) && ! defined( 'REST_REQUEST' );
380+
381+
if ( ! $frontend ) {
382+
return;
383+
}
384+
379385
if ( ! WC()->session->has_session() ) {
380386
WC()->session->set_customer_session_cookie( true );
381387
}

readme.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: automattic, woothemes, akeda, dwainm, royho, allendav, slash1andy,
33
Tags: ecommerce, e-commerce, commerce, woothemes, wordpress ecommerce, store, sales, sell, shop, shopping, cart, checkout, configurable, paypal
44
Requires at least: 4.4
55
Tested up to: 4.9.6
6-
Stable tag: 1.6.2
6+
Stable tag: 1.6.3
77
License: GPLv3
88
License URI: http://www.gnu.org/licenses/gpl-3.0.html
99

@@ -101,6 +101,9 @@ Please use this to inform us about bugs, or make contributions via PRs.
101101

102102
== Changelog ==
103103

104+
= 1.6.3 - 2018-08-15 =
105+
* Fix - Fatal error caused by a fix for Smart Payment Buttons.
106+
104107
= 1.6.2 - 2018-08-15 =
105108
* Fix - Tax not applied on the (Confirm your PayPal order) page at the checkout.
106109

woocommerce-gateway-paypal-express-checkout.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: WooCommerce PayPal Checkout Gateway
44
* Plugin URI: https://woocommerce.com/products/woocommerce-gateway-paypal-express-checkout/
55
* Description: A payment gateway for PayPal Checkout (https://www.paypal.com/us/webapps/mpp/paypal-checkout).
6-
* Version: 1.6.2
6+
* Version: 1.6.3
77
* Author: WooCommerce
88
* Author URI: https://woocommerce.com
99
* Copyright: © 2018 WooCommerce / PayPal.
@@ -27,7 +27,7 @@
2727
exit; // Exit if accessed directly
2828
}
2929

30-
define( 'WC_GATEWAY_PPEC_VERSION', '1.6.2' );
30+
define( 'WC_GATEWAY_PPEC_VERSION', '1.6.3' );
3131

3232
/**
3333
* Return instance of WC_Gateway_PPEC_Plugin.

0 commit comments

Comments
 (0)