Skip to content

Commit

Permalink
enable/disable guest checkout issue ref #309
Browse files Browse the repository at this point in the history
  • Loading branch information
kcppdevelopers committed Jun 19, 2017
1 parent 363a476 commit c69221d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions paypal-for-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -1305,18 +1305,21 @@ public function angelleye_paypal_pro_payflow_decrypt_gateway_api($bool) {

public function angelleye_express_checkout_woocommerce_enable_guest_checkout($bool) {
global $wpdb;
$return = $bool;
if (sizeof(WC()->session) == 0) {
return false;
}
$row = $wpdb->get_row( $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1", 'woocommerce_enable_guest_checkout' ) );
$paypal_express_checkout = WC()->session->get( 'paypal_express_checkout' );
$ec_save_to_account = WC()->session->get( 'ec_save_to_account' );
if( !empty($row->option_value) && $row->option_value == 'yes' && isset($paypal_express_checkout) && !empty($paypal_express_checkout) && isset($ec_save_to_account) && $ec_save_to_account == 'on') {
return 'no';
$return = 'no';
} else {
return $bool;
$return = $bool;
}
return apply_filters( 'woocommerce_enable_guest_checkout', $return);
}

public function angelleye_braintree_decrypt_gateway_api($bool) {
global $wpdb;
$row = $wpdb->get_row( $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1", 'woocommerce_braintree_settings' ) );
Expand Down

0 comments on commit c69221d

Please sign in to comment.