Skip to content

Instantly share code, notes, and snippets.

@xlplugins
Last active February 10, 2022 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xlplugins/c94674eb91564cd5a3d5c9799c58640a to your computer and use it in GitHub Desktop.
Save xlplugins/c94674eb91564cd5a3d5c9799c58640a to your computer and use it in GitHub Desktop.
Disable Aerocheckout page At Phone Order page by ignitwoo
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