Skip to content

Instantly share code, notes, and snippets.

View xlplugins's full-sized avatar

XLPlugins xlplugins

View GitHub Profile
@xlplugins
xlplugins / disallow_tokenization.php
Last active July 22, 2025 07:33
Disallow funnelkit stripe to save cards
/**
* Disallow funnelkit stripe to save cards
**/
add_filter('fkwcs_should_save_card',function( $save_card, $order) {
$order_id = $order->get_id();
$save_card = ( function_exists( 'wcs_order_contains_subscription' ) && ( wcs_order_contains_subscription( $order_id ) || wcs_is_subscription( $order_id ) || wcs_order_contains_renewal( $order_id ) ) );
return $save_card;
},10,2);
@xlplugins
xlplugins / Dequeue_theme_specific_CSS_JS_Funnelkit_Checkout.php
Last active April 16, 2025 04:57
Dequeue Theme specific CSS or JS on Funnelkit Checkout Final 16 April 2025
class WFACP_Theme_Dequeue_Specific_CSS_JS {
private $handler = [
'augury-woo-default',
'augury-woo',
];
public function __construct() {
add_action( 'wfacp_after_checkout_page_found', [ $this, 'action' ] );
@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 / gist:47193f40d26ddffefe5eceef1d0e71ff
Created January 31, 2024 14:33
Enable Coupon for Funnelkit cart
class FKWC_Enable_Coupon {
public function __construct() {
add_filter( 'woocommerce_coupons_enabled', [ $this, 'enable_coupon' ], 99 );
}
public function enable_coupon( $status ) {
if ( ! class_exists( '\FKCart\Plugin' ) ) {
@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 February 13, 2025 14:56
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 / fkwcs_api_keys_filters.php
Created September 14, 2023 14:53
Allow stripe keys to dynamically change
function is_CH_Country() {
if ( is_null( WC() ) || is_null( WC()->customer ) ) {
return false;
}
return WC()->customer->get_shipping_country() == "CH";
}
@xlplugins
xlplugins / cach enable
Created February 17, 2023 14:01
untitled
add_filter( 'wfacp_caching_support', '__return_true' );