Skip to content

Commit

Permalink
Express Checkout - PHP Fatal Error - call to a member function get() …
Browse files Browse the repository at this point in the history
…, ref #697
  • Loading branch information
kcppdevelopers committed May 7, 2017
1 parent 5dd8652 commit 5fa7ee2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public function ec_get_checkout_url($action) {

public function ec_is_express_checkout() {
if (sizeof(WC()->session) == 0) {
return false;
}
return false;
}
$paypal_express_checkout = WC()->session->get( 'paypal_express_checkout' );
return isset($paypal_express_checkout);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@ public function ec_disable_gateways($gateways) {

public function ec_add_body_class($classes) {
try {
if (sizeof(WC()->session) == 0) {
return $classes;
}
$paypal_express_terms = WC()->session->get( 'paypal_express_terms' );
if ($this->ec_is_checkout() && $this->function_helper->ec_is_express_checkout()) {
$classes[] = 'express-checkout';
Expand Down Expand Up @@ -319,6 +322,9 @@ public function ec_cancel_link() {
}

public function ec_terms_express_checkout($checked_default) {
if (sizeof(WC()->session) == 0) {
return $checked_default;
}
if (!$this->ec_is_available() || !$this->function_helper->ec_is_express_checkout()) {
return $checked_default;
}
Expand Down Expand Up @@ -521,6 +527,9 @@ public function angelleye_woocommerce_is_sold_individually($return, $data) {
}

public function angelleye_ship_to_different_address_checked($bool) {
if (sizeof(WC()->session) == 0) {
return $bool;
}
$post_data = WC()->session->get( 'post_data' );
if(!empty($post_data['ship_to_different_address']) && $post_data['ship_to_different_address'] == '1') {
return 1;
Expand Down

0 comments on commit 5fa7ee2

Please sign in to comment.