Skip to content

Instantly share code, notes, and snippets.

View xlplugins's full-sized avatar

XLPlugins xlplugins

View GitHub Profile
@xlplugins
xlplugins / Disable woocommerce native email when sublium process running
Last active June 25, 2026 14:39
Disable woocommerce native email when sublium process running
class Sublium_Disable_Renewal_Emails {
public static function init() {
$email_ids = array(
'new_order',
'customer_processing_order',
'customer_completed_order',
'customer_on_hold_order',
@xlplugins
xlplugins / exclude shipping in cart summary
Created June 25, 2026 12:31
exclude shipping in cart summary
// FKCart: show recurring total as product price + tax only (no shipping), subscriptions only.
add_action( 'fkcart_after_order_summary', function () {
if ( empty( WC()->cart->recurring_carts ) ) {
return;
}
foreach ( WC()->cart->recurring_carts as $recurring_cart ) {
$recurring_cart->set_total( (float) $recurring_cart->get_subtotal() + (float) $recurring_cart->get_subtotal_tax() );
}
}, 5 );
@xlplugins
xlplugins / Weight Based Shipping fix
Created June 23, 2026 15:04
Weight Based Shipping fix
<?php
/**
* Plugin Name: WFACP — make shipping Phone actually required (Weight Based Shipping fix)
*
* In plain terms:
* The shipping "Phone" field is set to required, but customers can still
* check out with it empty. This puts the requirement back.
*
* Why it broke:
* In this checkout layout WooCommerce doesn't re-check shipping fields, and the
@xlplugins
xlplugins / Happy Head - Move Turnstile widget above Order Now button.
Last active June 23, 2026 15:09
Happy Head - Move Turnstile widget above Order Now button.
/**
* Happy Head - Move Turnstile widget above Order Now button.
*
* WFACP re-renders .woocommerce-checkout-payment on every update_checkout AJAX call.
* ECFT outputs a bare .cf-turnstile div; Cloudflare only auto-renders on first page load,
* so we explicitly call turnstile.render() after each checkout fragment refresh.
*/
class Happy_Head_ECFT_Checkout_Position {
public function __construct() {
@xlplugins
xlplugins / donot_send_content_id_specific_product
Created June 17, 2026 12:38
Do not send content_id for specific product
add_filter( 'wffn_get_product_content_id',  'fk_skip_fb_content_id', 10, 2 );
add_filter( 'wfocu_get_product_content_id', 'fk_skip_fb_content_id', 10, 2 );
function fk_skip_fb_content_id( $content_id, $product_id ) {
$excluded_ids = array( 1469 );
return in_array( (int) $product_id, $excluded_ids, true ) ? '' : $content_id;
}
@xlplugins
xlplugins / create temporary email during checkout
Created June 17, 2026 12:25
create temporary email during checkout
<?php
/**
* Plugin Name: FunnelKit – Temporary Email on Checkout
* Description: Stamp a placeholder email on orders placed without one, so FunnelKit creates the contact.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@xlplugins
xlplugins / remove duplicate FKCart conversion rows.
Created June 12, 2026 09:19
remove duplicate FKCart conversion rows.
/**
* ONE-TIME cleanup: remove duplicate FKCart conversion rows.
* Keeps the earliest row per order; backs up removed rows first (reversible).
*
* Admin only:
* /wp-admin/?fkcart_dedupe_conversions=report → counts only, no changes
* /wp-admin/?fkcart_dedupe_conversions=delete → backs up, then removes duplicates
* /wp-admin/?fkcart_dedupe_conversions=restore → undo (re-inserts from backup)
*
* Remove this snippet (and drop the *_dedup_bak tables) once you're done.
@xlplugins
xlplugins / FB_coupon_diagnostics.php
Created June 12, 2026 07:59
FB_coupon_diagnostics.php
class FB_Coupon_Diagnostics {
/** Logger source / log-file slug. */
private static $source = 'fb-coupon-diagnostics';
/** Per-request correlation id — unique to one HTTP request. */
private static $rid = null;
@xlplugins
xlplugins / restrict coupon on sublium item
Last active June 11, 2026 15:27
restrict coupon on sublium item
<?php
/**
* Sublium - Coupon restrictions for Subscribe & Save items
*
* Rules:
* - Percentage coupons do not apply to Subscribe & Save items.
* - Fixed coupons are blocked when a Subscribe & Save item exists in cart.
* - Fixed coupons already applied are automatically removed.
* - Percentage coupons are invalid when all cart items are Subscribe & Save items.
*/
@xlplugins
xlplugins / disable_browser_auto_translate.php
Created June 11, 2026 12:15
Disable Browser auto translate
/**
* Disable Google / Chrome auto-translate on FunnelKit Checkout pages only.
* Adds Google's page-level opt-out meta tag to the checkout <head>.
*/
add_action( 'wfacp_checkout_page_found', function ( $checkout_id ) {
add_action( 'wp_head', function () {
echo '<meta name="google" content="notranslate">' . "\n";
}, 1 );