Skip to content

Instantly share code, notes, and snippets.

View xlplugins's full-sized avatar

XLPlugins xlplugins

View GitHub Profile
@xlplugins
xlplugins / Saved Addresses Trigger Fk checkout Field Change Events
Created May 6, 2026 12:34
Saved Addresses Trigger Fk checkout Field Change Events
/**
* Plugin Name: Saved Addresses → Trigger Field Change Events
* Description: The "Saved Addresses for WooCommerce" plugin auto-fills checkout
* address fields via jQuery .val() but never triggers input/change
* events. That breaks floating-label libraries (labels stay in
* their empty-state position over the filled value), WC's
* update_checkout listeners, and any third-party validators bound
* to those fields. This snippet listens for the plugin's two AJAX
* actions and dispatches input/change/keyup/blur on every populated
* billing & shipping field after the response handler finishes.
@xlplugins
xlplugins / express as inline in payment method list
Created May 6, 2026 06:38
express as inline in payment method list
<?php
/**
* FunnelKit Stripe — render inline Google Pay / Apple Pay buttons inside the
* payment-method <li> instead of beside the WooCommerce Place Order button.
*
* Drop into a child theme's functions.php, an mu-plugin file, or Code Snippets.
*/
add_action( 'fkwcs_stripe_apple_pay_after_payment_field_checkout', static function () {
echo '<div class="fkwcs_stripe_apple_pay_button fkwcs-inline-relocated"></div>';
@xlplugins
xlplugins / FK Uncode Variation Gallery Bridge
Created May 5, 2026 11:47
FK Uncode Variation Gallery Bridge
@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;