Skip to content

Instantly share code, notes, and snippets.

View xlplugins's full-sized avatar

XLPlugins xlplugins

View GitHub Profile
@xlplugins
xlplugins / mollie mandate find for order
Created June 11, 2026 08:58
mollie mandate find for order
/**
* TEMP DIAGNOSTIC — check Mollie mandates for a given order's customer right now.
* Run on the LIVE site as an admin: /wp-admin/?fk_check_mandate=5644
* Remove after testing.
*/
add_action( 'admin_init', function () {
if ( ! isset( $_GET['fk_check_mandate'] ) || ! current_user_can( 'manage_woocommerce' ) ) {
return;
}
@xlplugins
xlplugins / Relocate billing_company
Last active June 11, 2026 09:04
Relocate billing_company
/**
* Relocate billing_company / shipping_company on FunnelKit Checkout —
* ONLY on the checkout IDs you list below.
*/
add_filter( 'wfacp_get_fieldsets', function ( $fieldsets ) {
/* ---- EDIT THIS ----------------------------------------------------
* 1) Which checkouts should this run on? Put their checkout IDs here.
* Find the ID in the editor URL: admin.php?page=wfacp&wfacp_id=123
*/
@xlplugins
xlplugins / one button accepts ALL products in the offer
Created June 9, 2026 13:54
one button accepts ALL products in the offer
/**
* WFOCU – one button accepts ALL products in the offer.
*
* Add the CSS class `wfocu-accept-all` to one Accept Offer button.
* Clicking it adds every product from the offer's Products tab and charges
* them in one order.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
@xlplugins
xlplugins / fk_fb_every_4_minute_cron_interval.php
Created June 8, 2026 15:06
fk_fb_every_4_minute_cron_interval.php
/**
* Modify WFOCU cron schedule interval from 4 minutes to 20 minutes.
*
* The plugin registers a custom cron schedule 'wfocu_cron_schedule_times' at 4-minute
* intervals. This filter runs at priority 10000 (after WFOCU's own registration) to
* override the interval. The change takes effect on the next execution of the
* 'fk_fb_every_4_minute' event without requiring a manual reschedule.
*/
add_filter( 'cron_schedules', function( $schedules ) {
if ( isset( $schedules['wfocu_cron_schedule_times'] ) ) {
@xlplugins
xlplugins / Reload WFACP checkout once when wfacp_* session data is missing.
Last active June 5, 2026 14:57
Reload WFACP checkout once when wfacp_* session data is missing.
if ( ! class_exists( 'WFACP_Session_Guard' ) ) {
class WFACP_Session_Guard {
private static $instance = null;
public static function get_instance() {
if ( null === self::$instance ) {
self::$instance = new self();
}
@xlplugins
xlplugins / Create Klarna Element if not available on.
Created May 29, 2026 11:53
Create Klarna Element if not available on.
add_action( 'wp_footer', function() {
if ( ! is_product() && ! is_cart() && ! is_checkout() ) {
return;
}
?>
<script>
document.addEventListener('DOMContentLoaded', function() {
if (!document.getElementById('kec-pay-button')) {
var el = document.createElement('div');
el.id = 'kec-pay-button';
@xlplugins
xlplugins / kalvio newsletter subscribe
Created May 29, 2026 09:08
kalvio newsletter subscribe
<?php
/**
* Plugin Name: Plakatdyr — Klaviyo Consent Bridge for Aero Checkout
* Description: Ports the theme's newsletter consent checkbox (from woocommerce/checkout/form-coupon.php)
* into FunnelKit Aero (WFACP) checkout pages, so newsletter-terms reaches the backend on
* Aero orders too. Without this, Aero orders create Klaviyo profiles via the auto-tracking
* integration without consent flag → profile shows as Suppressed instead of Subscribed.
* Author: Plakatdyr Support
* Version: 1.0.0
*/
add_action( 'woocommerce_before_calculate_totals', function ( $cart ) {
if ( ! $cart instanceof WC_Cart || $cart->is_empty() ) {
return;
}
$contents = $cart->cart_contents;
if ( count( $contents ) < 2 ) {
return;
}
@xlplugins
xlplugins / choose_an_option_by_default.php
Last active May 27, 2026 11:14
choose an option by default on offer pages
add_filter( 'wfocu_show_default_variation_on_load', '__return_false' );
@xlplugins
xlplugins / Hide reward for listed countries
Last active June 1, 2026 08:51
Hide free shippig reward for listed countries
add_filter( 'fkcart_free_shipping', function ( $options ) {
if ( is_null( WC()->cart ) ) {
return false;
}
$location = WC_Geolocation::geolocate_ip( '', true, true );
$country = ! empty( $location['country'] ) ? strtoupper( $location['country'] ) : '';
if ( 'AU' !== $country ) {