Skip to content

Instantly share code, notes, and snippets.

View xlplugins's full-sized avatar

XLPlugins xlplugins

View GitHub Profile
@xlplugins
xlplugins / Funnelkit Checkout Bankful payment plugin comaptibility
Created April 30, 2026 09:26
Funnelkit Checkout Bankful payment plugin comaptibility
function shoptimizer_child_bankful_hosted_direct_redirect( $url, $order ) {
if ( ! function_exists( 'WC' ) || ! WC()->payment_gateways() ) {
return $url;
}
if ( ! $order instanceof WC_Order ) {
return $url;
}
if ( 'bankful_hosted_gateway' !== $order->get_payment_method() ) {
return $url;
}
@xlplugins
xlplugins / customer new param in capi events
Created April 28, 2026 15:29
customer new param in capi events
<?php
defined( 'ABSPATH' ) || exit;
add_filter(
'wffn_ecomm_tracking_fb_params',
static function ( $data, $order = null ) {
if ( ! $order instanceof WC_Order ) {
return $data;
}
@xlplugins
xlplugins / stripe card terms to never
Last active April 28, 2026 13:07
Hide stripe card terms message below credit card
add_filter( 'fkwcs_stripe_payment_element_data', function( $data, $gateway ) {
if ( ! is_array( $data ) || ! isset( $data['element_options'] ) ) {
return $data;
}
@xlplugins
xlplugins / move next button below mini cart
Last active April 28, 2026 12:36
move next button below mini cart
/**
* Move Next Step button below mini cart / order summary total.
* Pure JS approach — works with ALL page builders and templates.
* Add to theme's functions.php or a custom snippet plugin.
*/
add_action( 'wp_footer', 'wfacp_move_next_btn_below_total', 99 );
function wfacp_move_next_btn_below_total() {
if ( ! function_exists( 'wfacp_template' ) || ! wfacp_template() ) {
return;
@xlplugins
xlplugins / Plakatdyr theme compatibility
Last active May 1, 2026 12:19
Plakatdyr theme compatibility
<?php
/**
* Plugin Name: Plakatdyr — FunnelKit kundetype (MU)
* Description: Theme customer-type radios on FunnelKit only; plakatdr CSS if missing; small #plakatdr-kundete override so WFACP’s global input[type=radio] rules do not break layout.
* Version: 1.7.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@xlplugins
xlplugins / Only Allow one bump selection from given array of bump ids
Last active April 30, 2026 11:53
Only Allow one bump selection from given array of bump ids
class WFOB_Single_Bump_Selector {
private $bump_ids = array( 3094, 3095 ); // ← Your bump IDs here
public function __construct() {
add_action( 'wfob_before_add_to_cart', array( $this, 'remove_other_bumps' ), 5 );
add_action( 'wp_footer', array( $this, 'uncheck_other_bumps_js' ) );
}
@xlplugins
xlplugins / Wpb flush
Created April 23, 2026 05:31
Wpb flush
/**
* DB connection sync (shutdown)
* Description: Clears any pending MySQL result set on the default connection before other shutdown hooks run, reducing "Commands out of sync" errors from Action Scheduler, WooCommerce batch processing, Jetpack, and cron.
* Version: 1.0.0
*
* @package
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
@xlplugins
xlplugins / Tropics fields — FunnelKit checkout
Created April 21, 2026 05:53
Tropics fields — FunnelKit checkout
add_action(
'wp_enqueue_scripts',
static function () {
if ( ! function_exists( 'is_checkout' ) || ! is_checkout() || is_order_received_page() ) {
return;
}
/* FunnelKit not active — nothing to bridge. */
if ( ! class_exists( 'WFACP_Common' ) ) {
return;
@xlplugins
xlplugins / Register Paypal btn before the apple and gpay at funnelkit checkout
Created April 20, 2026 14:52
Register Paypal btn before the apple and gpay at funnelkit checkout
add_action( 'init', function () {
if( class_exists('\FunnelKit\PayPal\Compatibilities\FunnelKit\Checkout') ){
$instance = \FunnelKit\PayPal\Compatibilities\FunnelKit\Checkout::get_instance();
remove_filter( 'wfacp_smart_buttons', array( $instance, 'register_smart_button' ), 99 );
add_filter( 'wfacp_smart_buttons', array( $instance, 'register_smart_button' ), 10 );
}
} );
@xlplugins
xlplugins / Add_to_cart_open_slide_cart_on_elementor_button.php
Created April 20, 2026 11:32
Add to cart and open slide cart on elementor button.php
add_action('wp_footer',function(){
?>
<script>
jQuery(function ($) {
$('body').on('click', '.elementor-button-link', function (e) {
e.preventDefault();
var $button = $(this);