Skip to content

Instantly share code, notes, and snippets.

View xlplugins's full-sized avatar

XLPlugins xlplugins

View GitHub Profile
@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
Created December 10, 2025 13:35
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 = 'bacs';
@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;
@xlplugins
xlplugins / gist:5151bd303ee4c92a2dc1e1b70ffc086d
Created December 8, 2025 12:53
Funnelkit Checkout: Automatically adds a percentage-based fee to the
class Dynamic_Percentage_Cart_Fee {
// ==================== EASY CONFIGURATION ====================
// Change these values as needed (no technical knowledge required)
private $field_name = 'feecost'; // Change this to your field name
private $label = 'Yes i want to have these items shipped';
private $percentage = 10; // 10% of cart total
// ============================================================
@xlplugins
xlplugins / gist:d20c8233e78b4bc295b1a5bb7444a0c2
Created December 8, 2025 12:17
Dynamic Order Bump Auto-Selection Based on Cart Total Rules
class WFOB_Bump_Pre_Select_Fix {
/**
* OrderBump IDs to auto-select
*
* @var array
*/
private $bump_ids = array( 5641,5642,5643 ); // Your OrderBump IDs here in comma separated 2363, 2302, 2895
/**
@xlplugins
xlplugins / gist:f2815a2dd5ab9ecede7ea68ebfc84cd9
Last active December 5, 2025 14:51
Funnelkit Checkout: Change the cart Link url using Filter Hook
add_filter( 'wfacp_return_to_cart_link', function( $cart_url ) {
// Customize the cart URL
return '/shop/';
}, 10, 1 );
@xlplugins
xlplugins / gist:a72edb7288e3c2658eb6b806a50513e9
Created December 4, 2025 10:53
Funnelkit Cart: Displays minimum purchase error in FunnelKit slide cart
if ( ! class_exists( 'CT_MPAC_FKCart_Compat' ) ) {
class CT_MPAC_FKCart_Compat {
public function __construct() {
add_action( 'plugins_loaded', array( $this, 'init' ) );
}
public function init() {
// Check if both plugins are active
if ( ! class_exists( 'CtMPAC_Application' ) || ! class_exists( 'FKCart\Includes\Front' ) ) {
@xlplugins
xlplugins / gist:417b042f9c7a9be4211bb566aabc5220
Created December 4, 2025 10:11
Funnelkit Checkout: Auto-Advance Multi-Step Checkout After Smart Login
if (!class_exists('WFACP_Auto_Advance_After_Login')) {
/**
* Class WFACP_Auto_Advance_After_Login
*
* Auto-trigger the next page button after user logs in via smart login
* on specific multi-step checkout forms
*
* @since 1.0.0
*/
class WFACP_Auto_Advance_After_Login {