Skip to content

Commit

Permalink
enable/disable guest checkout using hook, ref #309
Browse files Browse the repository at this point in the history
  • Loading branch information
kcppdevelopers committed Sep 21, 2015
1 parent 867553d commit 5b106aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions classes/wc-gateway-paypal-express-angelleye.php
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ function paypal_express_checkout($posted = null) {
else {
$this->add_log("...ERROR: GetShippingDetails returned empty result");
}
if ($this->skip_final_review == 'yes' && get_option('woocommerce_enable_guest_checkout') === "yes" ) {
if ($this->skip_final_review == 'yes' && get_option('woocommerce_enable_guest_checkout') === "yes" && apply_filters( 'woocommerce_enable_guest_checkout', get_option('woocommerce_enable_guest_checkout'))) {
//check terms enable
$checkout_form_data = maybe_unserialize(WC()->session->checkout_form);
if (!( wc_get_page_id( 'terms' ) > 0 && apply_filters( 'woocommerce_checkout_show_terms', true ) && empty( $checkout_form_data['terms'] ))) {
Expand Down Expand Up @@ -993,7 +993,7 @@ function paypal_express_checkout($posted = null) {
}
}
} elseif (isset($_GET['pp_action']) && $_GET['pp_action'] == 'payaction') {
if (isset($_POST) || ($this->skip_final_review == 'yes' && get_option('woocommerce_enable_guest_checkout') === "yes")) {
if (isset($_POST) || ($this->skip_final_review == 'yes' && get_option('woocommerce_enable_guest_checkout') === "yes" && apply_filters( 'woocommerce_enable_guest_checkout', get_option('woocommerce_enable_guest_checkout')))) {

// Update customer shipping and payment method to posted method
$chosen_shipping_methods = WC()->session->get('chosen_shipping_methods');
Expand Down

0 comments on commit 5b106aa

Please sign in to comment.