Skip to content

Instantly share code, notes, and snippets.

View xlplugins's full-sized avatar

XLPlugins xlplugins

View GitHub Profile
@xlplugins
xlplugins / min characted for place api new
Created October 7, 2026 11:27
min characted for place api new
/**
* FunnelKit Checkout: show Google address suggestions after fewer characters (default 3).
*/
add_action( 'wp_footer', function () {
if ( ! wp_script_is( 'wfacp_checkout_js', 'enqueued' ) ) {
return;
}
$min_chars = 1; // 1, 2 or 3.
wp_add_inline_script( 'wfacp_checkout_js', 'wfacp_frontend.hooks.addFilter( "wfacp_google_autocomplete_min_chars", function () { return ' . absint( $min_chars ) . '; } );' );
}, 1 );
@xlplugins
xlplugins / Show the quantity switcher for "Sold individually" products
Created October 7, 2026 10:14
Show the quantity switcher for "Sold individually" products
/**
* Show the quantity switcher for "Sold individually" products.
*/
add_filter( 'woocommerce_is_sold_individually', function ( $sold_individually, $product ) {
// 1. Classic cart page display
if ( did_action( 'wp' ) ) {
return false;
}
@xlplugins
xlplugins / disable product switcher shimmer
Created October 1, 2026 13:19
disable product switcher shimmer
add_action( 'wp_footer', function () {
?>
<script>
jQuery( function ( $ ) {
// Runs right after Aero's change handlers (bound on body) add the product switcher shimmer class, before it paints.
$( document ).on( 'change', '#product_switching_field', function () {
$( this ).removeClass( 'wfacp_animation_start' );
} );
} );
</script>
@xlplugins
xlplugins / add domain in billing email suggestion
Created October 1, 2026 11:48
add domain in billing email suggestion
add_filter( 'wfacp_email_suggestion_domains', function ( $domains ) {
$domains[] = 'mycorpmail.com';
$domains[] = 'web.de';
return $domains;
} );
@xlplugins
xlplugins / Hide express checkout if particular product is in the cart shipping protection
Created October 1, 2026 07:30
Hide express checkout if particular product is in the cart shipping protection
/**
* Hide FunnelKit express checkout buttons when Gift Wrapping is in the cart.
* Works on page load and after AJAX cart updates (order bump, qty change, etc.).
*/
if ( ! function_exists( 'fk_giftwrap_hide_express_css' ) ) {
function fk_giftwrap_in_cart() {
$gift_wrap_ids = array( 14857 ); // Gift Wrapping product ID(s)
if ( ! function_exists( 'WC' ) || ! WC()->cart ) {
@xlplugins
xlplugins / ThemeREX Addons defer intl js
Created October 1, 2026 07:21
ThemeREX Addons defer intl js
add_filter( 'trx_addons_filter_skip_async_scripts_load', function ( $list ) {
$list[] = 'intltelinput'; // FunnelKit checkout phone field library
return $list;
} );
@xlplugins
xlplugins / Show hide express button with shipping protection in sliding cart
Created September 30, 2026 13:23
Show hide express button with shipping protection in sliding cart
<?php
/**
* FunnelKit Sliding Cart: hide Apple Pay / Google Pay express buttons
* when the Shipping Protection add-on is enabled (buying it).
*/
add_action( 'wp_footer', function () {
$protection_product_id = 35; // Shipping protection add-on product ID
?>
<style>
@xlplugins
xlplugins / FK Tracking Settings Audit
Created September 28, 2026 08:20
FK Tracking Settings Audit
/**
* Plugin Name: FK Tracking Settings Audit (bwf_gen_config)
* Description: TEMPORARY diagnostic. Logs every change to FunnelKit's Pixel Tracking / general
* settings (option `bwf_gen_config`, which holds the GA Analytics ID `ga_key`,
* FB/GAds/TikTok/Pinterest/Snapchat keys, page bases, etc.) with the user, request
* context, the exact keys that changed (old -> new), and a full PHP backtrace so you
* can see WHICH code path altered it. Remove this file once traced.
* Author: FunnelKit Support
* Version: 1.0.0
*/
@xlplugins
xlplugins / Order Bump - dynamic SKU bump replace
Created September 25, 2026 06:56
Order Bump - dynamic SKU bump replace
<?php
/**
* Plugin Name: Order Bump - dynamic SKU upgrade
* Description: Offers and replaces the matching cart product dynamically, so one bump covers every
* SKU pair instead of one bump per product.
*/
defined( 'ABSPATH' ) || exit;
if ( ! class_exists( 'FKOB_Dynamic_SKU_Upgrade' ) ) {
@xlplugins
xlplugins / Checkout AJAX profiler
Created September 23, 2026 13:44
Checkout AJAX profiler
/**
* Plugin Name: Checkout AJAX profiler
* Description: Logs where time goes during the checkout AJAX calls — every outbound HTTP request
* with the code that made it, plus the hook timeline with a stack at each stall.
* Nothing to define, nothing to configure.
* Read at WooCommerce > Status > Logs > checkout-profiler. Delete when finished.
*/
defined( 'ABSPATH' ) || exit;