Skip to content

Instantly share code, notes, and snippets.

@xlplugins
Created November 25, 2022 07:37
Show Gist options
  • Save xlplugins/09436ca2d59537e3d605f89359a3a7f5 to your computer and use it in GitHub Desktop.
Save xlplugins/09436ca2d59537e3d605f89359a3a7f5 to your computer and use it in GitHub Desktop.
If checkout overridden by store checkout funnel
<?php
function if_funnel_has_store_checkout_set() {
if ( ! class_exists( 'WFFN_Common' ) || ! method_exists( 'WFFN_Common', 'get_store_checkout_id' ) || 0 === WFFN_Common::get_store_checkout_id() ) {
return false;
}
$funnel = new WFFN_Funnel( WFFN_Common::get_store_checkout_id() );
/**
* Check if this is a valid funnel and has native checkout
*/
if ( ! wffn_is_valid_funnel( $funnel ) ) {
return false;
}
/**
* if native checkout set in store chekout funnel
*/
if ( true === $funnel->is_funnel_has_native_checkout() ) {
return false;
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment