Skip to content

Instantly share code, notes, and snippets.

View xlplugins's full-sized avatar

XLPlugins xlplugins

View GitHub Profile
@xlplugins
xlplugins / optin-form-submission-through-webhook
Created January 21, 2026 06:29
optin conversion through webhook youcanbookme.com
<?php
/**
* Plugin Name: You can book me webhook endpoint
* Description: Receives webhook from YouCanBookMe and saves as optin conversion
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@xlplugins
xlplugins / Add_JS_code_in_header_for_specific_sales_page
Created January 19, 2026 13:21
Add JS code in header for specific sales page
add_action( 'wp_head', 'wffn_custom_script_on_landing_option_page' );
function wffn_custom_script_on_landing_option_page() {
global $post;
if ( is_null( $post ) ) {
return;
}
// Check if the post ID matches the specific sales page ID (replace 123 with your desired page ID)
$target_page_id = 104; // Replace with the sales page ID where you want the script to run
if ( $post->ID != $target_page_id ) {
@xlplugins
xlplugins / gist:de02a17ff1856c137c8cf551551d2900
Created January 19, 2026 12:43
Change free shipping text in mini cart summary to "FREE pick-up at RMWSB" Only applies in the summary section, NOT in the shipping calculator
/**
* Change free shipping text in mini cart summary to "FREE pick-up at RMWSB"
* Only applies in the summary section, NOT in the shipping calculator
*/
add_filter( 'wc_cart_totals_shipping_method_cost', function( $output, $method ) {
// Safety checks: Only run on FunnelKit checkout pages
if ( ! class_exists( 'WFACP_Common' ) ) {
return $output;
}
@xlplugins
xlplugins / gist:76b5ecf68a7ebd99bfc97aa6d4662bfd
Created January 17, 2026 06:28
Funnelkit Compatibility class for Alegra WooCommerce Sync with FunnelKit Checkout
class WFACP_Compatibility_With_Alegra_WC_Sync {
private $alegra_fields = [];
private $registered_fields = [];
public function __construct() {
// Hook early to capture Alegra fields
add_action( 'wfacp_after_checkout_page_found', [ $this, 'capture_alegra_fields' ], 5 );
// Ensure Alegra fields are properly registered
@xlplugins
xlplugins / gist:f619cc72e4ea68c69340f5e6ff2c70a1
Last active January 23, 2026 06:08
FKCART Bulgarian Eurozone Integration — Dual Currency Display for Cart Items
class FKCART_Bulgarian_Eurozone_Integration {
private $instance = null;
public function __construct() {
// Hook into FunnelKit cart initialization
add_filter( 'fkcart_enable_item_link', [ $this, 'add_item_meta' ] );
// Hook into FunnelKit checkout button total display
// This filter is used in cart-cta.php line 54 to display the cart total
@xlplugins
xlplugins / gist:8470615fc9c3f6c78ac006de80ebc7ba
Last active January 16, 2026 08:12
FunnelKit Checkout Email Validation (domain based)
/**
* Block temporary/disposable email domains during WooCommerce checkout
* Add this to your theme's functions.php file
*/
// Blocked email domains list
function fk_wc_get_blocked_email_domains() {
$domains = array(
'mailnetter.com',
'mailnetter.net',
@xlplugins
xlplugins / gist:6c30886ac1a7ee859956e4f38b9d9a2c
Created January 15, 2026 14:00
Disable theme's WooCommerce standard page filter
add_filter( 'theme_mod_penci_woocommerce_standard_page', function( $value ) {
// Check if we're on checkout page
if ( is_checkout() ) {
$value=false;
}
return $value;
}, 999 );
@xlplugins
xlplugins / gist:6f2b4c33a8d68586057012a775fbd03d
Created January 14, 2026 12:15
Trigger WooCommrce Thankyou hook for bacs on demand with shortcode
// Custom Shortcode to Trigger WooCommerce 'thankyou' Hook
function custom_thankyou_shortcode($atts) {
// Check if WooCommerce is active
if (class_exists('WooCommerce') && function_exists('WFFN_Core') && method_exists(WFFN_Core(), 'get_instance') && method_exists(WFFN_Core()->thank_you_pages, 'execute_wc_thankyou_hooks')) {
// Trigger the WooCommerce 'thankyou' hook
ob_start();
$order = WFFN_Core()->thank_you_pages->data->get_order();
do_action( "woocommerce_thankyou_bacs", $order->get_id() );
remove_all_actions( "woocommerce_thankyou_bacs" );
$output = ob_get_clean();
@xlplugins
xlplugins / gist:5f746115bf2adf9652ed6e9bd8065450
Created January 13, 2026 06:31
Funnelkit Bump Compatibility: Order Bumps with WooCommerce Product Price Based on Countries
if ( ! class_exists( 'WFOB_Compatibility_With_Price_Based_Country' ) ) {
class WFOB_Compatibility_With_Price_Based_Country {
/**
* Initialize hooks
*/
public function __construct() {
add_filter( 'wfob_product_switcher_price_data', [ $this, 'update_price_data' ], 10, 2 );
add_filter( 'wfob_discount_regular_price_data', [ $this, 'update_discount_price' ], 10, 2 );
add_filter( 'wfob_discount_price_data', [ $this, 'update_discount_price' ], 10, 2 );
@xlplugins
xlplugins / gist:d92c6a3d5b9766289e390848a38877fb
Created January 12, 2026 14:05
Prevent address field changes from triggering update_order_review AJAX calls
class WFACP_Prevent_Address_Field_Updates {
/**
* Address fields that shouldn't trigger order review updates
*
* @var array
*/
private $address_fields = array(
'billing_postcode',
'billing_city',