Skip to content

Instantly share code, notes, and snippets.

View xlplugins's full-sized avatar

XLPlugins xlplugins

View GitHub Profile
@xlplugins
xlplugins / gist:aad003546575c964086c9ea1c0a00558
Created December 18, 2025 12:47
Funnelkit Checkout: Unset billing Document
add_filter( 'woocommerce_checkout_fields', 'custom_override_checkout_fields', 9999999 );
function custom_override_checkout_fields( $fields ) {
if(!$_POST['billing_document']){
unset( $fields['billing']['billing_document']['required'] );
}
return $fields;
}
@xlplugins
xlplugins / gist:b628d96487a508e50b744fa7b3eac56c
Created December 16, 2025 10:57
Trigger Slide Cart on Shop Page When Returning from Checkout
class Fkcart_Trigger_Slide_cart_retrun_from_checkout {
public function __construct() {
add_action( 'wp_footer', [ $this, 'js' ] );
}
public function js() {
if(!is_shop()) {
@xlplugins
xlplugins / gist:6d2a3fb7612487166a9074df6d549248
Created December 15, 2025 12:55
Funnelkit order Bump: Exclude bump Js from Sg Optimizer
add_filter( 'sgo_js_minify_exclude', 'emd_exclude_mv_scripts_handles' );
add_filter( 'sgo_javascript_combine_exclude', 'emd_exclude_mv_scripts_handles' );
add_filter( 'sgo_js_async_exclude', 'emd_exclude_mv_scripts_handles' );
function emd_exclude_mv_scripts_handles( $exclude_list ) {
$exclude_list[] = 'wfob-bump';
return $exclude_list;
}
@xlplugins
xlplugins / Disable JetEngine Listing Overlay Click While Preserving Add to Cart (JetEngine Compatibility Fix) - Crocoblock
Last active December 15, 2025 12:05
Cart: Disable JetEngine Listing Overlay Click While Preserving Add to Cart (JetEngine Compatibility Fix) - Crocoblock
add_action( 'wp_footer', function () {
?>
<script type="text/javascript">
(function($){
/**
* -------------------------------
* 1. Your cart property logic
* -------------------------------
@xlplugins
xlplugins / gist:fc5ec58fcad471cad4557a4e5f8e3179
Created December 15, 2025 08:40
Funnelkit Checkout: Moyasar Payment Gateway - FunnelKit Checkout Compatibility Fix
add_action('wp_enqueue_scripts', function() {
// Only run on checkout pages
if (!is_checkout()) {
return;
}
// Check if FunnelKit is active and we're on a FunnelKit checkout page
if (!class_exists('WFACP_Common')) {
return;
}
@xlplugins
xlplugins / gist:9735f250b551e554a990330b4b9e3aa2
Created December 12, 2025 13:09
Order Bump Product Cloner with Discount
class DoubleYourBump {
/**
* Order Bump ID
*/
private $order_bump_id = 5699; // Order Bump
/**
* Discount percentage (e.g., 10 for 10% off, 20 for 20% off)
@xlplugins
xlplugins / gist:ae556268a8612ad83b82f60592f3f3dc
Created December 12, 2025 08:32
Funnelkit Cart: Enqueue The cart fragments on the single product page
function load_wc_cart_fragments() {
if (is_product()) {
wp_enqueue_script('wc-cart-fragments');
}
}
add_action('wp_enqueue_scripts', 'load_wc_cart_fragments',9999);
@xlplugins
xlplugins / show_address_fields_when_specific_payment_method_is_selected.php
Last active January 7, 2026 09:17
Show address fields when specific payment method is selected
class TEMP_WFACP_Conditional_Field_Depend_On_Payment {
private $conditional_field = [];
private $exclude_wfacp_ids = [];
/**
* @var string Payment method bank transfer selected then show fields
*/
private $payment_method_selected = 'fkwcs_stripe_klarna';
@xlplugins
xlplugins / gist:b12507742af229a22f32ebb142b223e4
Created December 10, 2025 13:28
Add Plausible analytics tracking class to FunnelKit Checkout place order button
add_filter( 'woocommerce_order_button_html', function( $button_html ) {
// Check if we're on a FunnelKit checkout page
if ( ! function_exists( 'wfacp_template' ) ) {
return $button_html;
}
$instance = wfacp_template();
if ( ! $instance ) {
return $button_html;
}
@xlplugins
xlplugins / gist:8a3232e8a693935f1e3e4768936b98c8
Created December 10, 2025 08:31
Funnelkit Order Bump: Enables cascading/sequential order bumps functionality where selecting one order bump can trigger another bump to appear based on cart rules.
if ( ! class_exists( 'WFOB_Cascading_Bumps_Handler' ) ) {
class WFOB_Cascading_Bumps_Handler {
/**
* Flag to track if fragment unsetting should be processed
*
* @var bool
*/
private $process = false;