Skip to content

Instantly share code, notes, and snippets.

View xlplugins's full-sized avatar

XLPlugins xlplugins

View GitHub Profile
@xlplugins
xlplugins / Funnelkit Checkout: Dequeue Theme Assets on the checkout page
Created April 24, 2024 07:17
Funnelkit Checkout: Dequeue Theme Assets on the checkout page
add_action( 'wfacp_after_checkout_page_found', function () {
if ( function_exists( 'consulting_load_theme_scripts_and_styles' ) ) {
remove_action( 'wp_enqueue_scripts', 'consulting_load_theme_scripts_and_styles' );
}
} );
@xlplugins
xlplugins / Register New Date Advanced field type in the rest API
Last active March 13, 2024 08:20
Register New Date Advanced field type in the rest API
add_filter('wfacp_register_advanced_field_types',function($fields_types){
$fields_types[]=[
'label' => __( 'Date', 'woofunnels-aero-checkout' ),
'value' => 'wfacp_date',
'key' => 'wfacp_date',
];
return $fields_types;
},999);
@xlplugins
xlplugins / Allow Directory pro postypes in Funnelkit Plugins
Created February 13, 2024 06:59
Allow Directory pro postypes in Funnelkit Plugins
if ( ! class_exists( 'Funnelkit_Post_Type_allow' ) ) {
class Funnelkit_Post_Type_allow {
public function __construct() {
add_filter( 'wfob_offer_product_types', [ $this, 'add_post_types' ] );
add_filter( 'wfacp_offer_product_types', [ $this, 'add_post_types' ] );
add_filter( 'fkcart_product_types', [ $this, 'add_post_types' ] );
add_filter( 'wfocu_offer_product_types', [ $this, 'add_post_types' ] );
}
public function add_post_types( $supported_post_types ) {
@xlplugins
xlplugins / force payment method fragments in update order review ajax
Last active January 24, 2024 11:27
force payment method fragments in update order review ajax
add_filter( 'woocommerce_update_order_review_fragments', function ( $fragments ) {
if ( isset( $fragments['.woocommerce-checkout-payment'] ) && empty( $fragments['.woocommerce-checkout-payment'] ) ) {
ob_start();
if ( WC()->cart->needs_payment() ) {
$available_gateways = WC()->payment_gateways()->get_available_payment_gateways();
WC()->payment_gateways()->set_current_gateway( $available_gateways );
} else {
$available_gateways = array();
}
@xlplugins
xlplugins / Disable Theme cart icon and attach FK Cart
Created November 6, 2023 11:18
Disable Theme cart icon and attach FK Cart
add_filter( 'jas_gecko_wc_shopping_cart', 'vincijaswim_disable_header_cart', 9999 );
function vincijaswim_disable_header_cart( $output ) {
return do_shortcode( '[fk_cart_menu]' );
}
@xlplugins
xlplugins / Display Regular Price with Order total, sub total in mini cart
Last active March 26, 2024 11:45
Display Regular Price with Order total, sub total in mini cart final
class WFACP_Display_Regular_price_In_Mini_Cart {
public $regular_price = '';
public $tmp_reg_price = [];
public $is_on_sale_active = '';
public function __construct() {
add_filter( 'wfacp_woocommerce_cart_item_subtotal_except_subscription', '__return_false' );
add_action( 'wfacp_woocommerce_cart_item_subtotal_except_subscription_placeholder', [ $this, 'display_cut_price' ], 10, 3 );
add_filter( 'wfacp_subscription_price_display', [ $this, 'display_cut_price_subscription' ], 10, 4 );
add_action( 'wfacp_template_load', [ $this, 'action' ] );
@xlplugins
xlplugins / cach enable
Created February 17, 2023 14:01
untitled
add_filter( 'wfacp_caching_support', '__return_true' );
@xlplugins
xlplugins / refresh payment gateway at checkout page
Created October 11, 2022 11:13
refresh payment gateway at checkout page
add_filter( 'wfacp_need_payment_gateway_refresh', function () {
return true;
}, 100 );
@xlplugins
xlplugins / WF_Allow_Theme_CSS_JS
Last active July 25, 2023 07:48
Allow theme scripts for particular step #upsell #funnelkit #theme css
class WF_Allow_Theme_CSS_JS {
private $allow_post_type = [
'wffn_landing',
'wffn_ty',
'wffn_optin',
'wffn_oty',
];
@xlplugins
xlplugins / allow-current-theme-scripts-for-particular-step
Last active December 6, 2022 14:40
Allow current theme scripts for particular step #Upstroke #woofunnels #theme css
add_filter('wffn_allowed_themes', 'wffn_allow_current_theme_scripts' ); //for funnel builder pages ( sale, optin, optin thankyou and wc thankyou )
// add_filter('wfocu_allowed_themes', 'wffn_allow_current_theme_scripts' );// only for Upsell offer page
function wffn_allow_current_theme_scripts( $args ){
//Allow current theme scripts and css for particular step in canvas template
//'wfacp_checkout' for checkout
//'wfocu_offer' for upsell
//'wffn_landing' for landing
//'wffn_ty' for wc thankyou