Skip to content

Instantly share code, notes, and snippets.

View xlplugins's full-sized avatar

XLPlugins xlplugins

View GitHub Profile
@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 () {
@xlplugins
xlplugins / FKCart WooRewards (Loyalty)
Last active March 3, 2026 08:09
FKCart WooRewards (Loyalty)
// Load WR assets on all pages (plugin normally only loads on cart/checkout)
add_action( 'wp_enqueue_scripts', function() {
if ( is_admin() || ( function_exists( 'is_checkout' ) && is_checkout() ) ) {
return;
}
if ( ! class_exists( '\FKCart\Includes\Data' ) || ! \FKCart\Includes\Data::is_cart_enabled( 'all' ) ) {
return;
}
if ( ! defined( 'LWS_WOOREWARDS_VERSION' ) ) {
@xlplugins
xlplugins / global order bump according to checkout id
Last active March 5, 2026 14:09
global order bump according to checkout id
/**
* Plugin Name: Order Bump - Show by Page ID
* Description: Bump 1576 on page 10, bump 2910 on page 2906.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
add_filter( 'wfob_filter_final_bumps', function( $final_bumps, $posted_data ) {
$page_id = 0;
if ( function_exists( 'wc_get_page_id' ) && function_exists( 'is_checkout' )) {