Skip to content

Instantly share code, notes, and snippets.

View xlplugins's full-sized avatar

XLPlugins xlplugins

View GitHub Profile
@xlplugins
xlplugins / Reload issue with slide cart
Created March 13, 2026 15:00
Reload issue with slide cart
add_action( 'wp_enqueue_scripts', function() {
if ( ! apply_filters( 'fkcart_prevent_cart_reload', true ) ) {
return;
}
if ( is_cart() ) {
return;
}
$inline = <<<'JS'
(function($){
$(document).on('added_to_cart.wc-cart wc_update_cart.wc-cart', function(e){
@xlplugins
xlplugins / Reload issue with slide cart
Last active March 13, 2026 15:00
Reload issue with slide cart
add_action( 'wp_enqueue_scripts', function() {
if ( ! apply_filters( 'fkcart_prevent_cart_reload', true ) ) {
return;
}
if ( is_cart() ) {
return;
}
$inline = <<<'JS'
(function($){
$(document).on('added_to_cart.wc-cart wc_update_cart.wc-cart', function(e){
@xlplugins
xlplugins / lebagol theme global checkout conflict
Created March 10, 2026 14:37
lebagol theme global checkout conflict
/**
* FunnelKit checkout: replace post in theme loop so FunnelKit checkout content is used.
* When template is "theme", page.php runs have_posts/the_post with the default WooCommerce checkout page.
* This replaces $post with the FunnelKit checkout post so the_content() outputs the correct form.
*/
add_action( 'lebagol_page', function() {
if ( ! function_exists( 'is_checkout' ) || ! is_checkout() ) {
return;
}
if ( ! class_exists( 'WFACP_Common' ) ) {
@xlplugins
xlplugins / FunnelKit + Automatic CSS Checkout Fix
Created March 10, 2026 12:39
FunnelKit + Automatic CSS Checkout Fix
<?php
/**
* Plugin Name: FunnelKit + Automatic CSS Checkout Fix
* Description: Disables Automatic CSS on FunnelKit checkout. Add to mu-plugins.
*
* Automatic CSS uses a custom Style_Queue (not wp_styles), so wp_dequeue_style() has no effect.
* The only way is to remove its wp_head callback. We find it by class and unset directly
* since remove_action requires the exact object reference.
*/
add_action( 'template_redirect', 'funnelkit_disable_automaticcss_on_checkout', 1 );
@xlplugins
xlplugins / FunnelKit + Automatic CSS Checkout Fix
Created March 10, 2026 12:39
FunnelKit + Automatic CSS Checkout Fix
<?php
/**
* Plugin Name: FunnelKit + Automatic CSS Checkout Fix
* Description: Disables Automatic CSS on FunnelKit checkout. Add to mu-plugins.
*
* Automatic CSS uses a custom Style_Queue (not wp_styles), so wp_dequeue_style() has no effect.
* The only way is to remove its wp_head callback. We find it by class and unset directly
* since remove_action requires the exact object reference.
*/
add_action( 'template_redirect', 'funnelkit_disable_automaticcss_on_checkout', 1 );
@xlplugins
xlplugins / Show strike-through price for subscription product in fkcart
Created March 6, 2026 14:48
Show strike-through price for subscription product in fkcart
/**
* Snippet: Show strike-through price and "Save X%" for subscription products in Cart for WooCommerce
* Add to theme functions.php or Code Snippets.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
add_filter( 'fkcart_disable_strike_price_product_type', function ( $excluded_types ) {
return array_diff( $excluded_types, [ 'subscription', 'variable-subscription', 'subscription_variation' ] );
@xlplugins
xlplugins / Tax Switch for WooCommerce cart compatibility
Created March 5, 2026 13:18
Tax Switch for WooCommerce cart compatibility
/**
* Plugin Name: FKCart Tax Switch Suppress
* Description: Hides Tax Switch dual price (incl/excl VAT) only in the cart icon/menu.
* Keeps it active in the cart modal, product pages, etc.
* Uses FKCart's native hooks - no backtrace.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@xlplugins
xlplugins / refresh checkout on session expiry
Last active March 5, 2026 09:37
refresh checkout on session expiry
/**
* If update_order_review returns and woocommerce_cart_hash cookie is not found → refresh checkout once.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
add_action( 'wp_footer', 'keep_wc_session_refresh_script', 20 );
function keep_wc_session_refresh_script() {
@xlplugins
xlplugins / razzi theme login form
Created March 5, 2026 07:25
razzi theme login form
/**
* Plugin Name: WFACP + Razzi: Suppress Duplicate Login
* Description: Removes Razzi's native login/coupon block on FunnelKit checkout (PHP compatibility).
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
add_action( 'wfacp_after_checkout_page_found', function () {
@xlplugins
xlplugins / razzi theme login form
Created March 5, 2026 07:25
razzi theme login form
/**
* Plugin Name: WFACP + Razzi: Suppress Duplicate Login
* Description: Removes Razzi's native login/coupon block on FunnelKit checkout (PHP compatibility).
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
add_action( 'wfacp_after_checkout_page_found', function () {