Last active
February 10, 2022 13:33
-
-
Save xlplugins/c94674eb91564cd5a3d5c9799c58640a to your computer and use it in GitHub Desktop.
Disable Aerocheckout page At Phone Order page by ignitwoo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class WFACP_Phone_Order_Disable_Temp { | |
public function __construct() { | |
add_filter( 'wfacp_skip_checkout_page_detection', [ $this, 'disallow' ] ); | |
} | |
public function disallow( $status ) { | |
if ( false !== strpos( $_SERVER['REQUEST_URI'], '/phone-order/' ) ) { | |
return true; | |
} | |
if ( empty( $_REQUEST['post_data'] ) ) { | |
return $status; | |
} | |
$args = wp_parse_args( $_REQUEST['post_data'] ); | |
if ( isset( $args['opc_checkout_flag'] ) ) { | |
if ( class_exists( 'WFACP_Template_loader' ) ) { | |
return true; | |
} | |
} | |
return $status; | |
} | |
} | |
new WFACP_Phone_Order_Disable_Temp(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment