Skip to content

Instantly share code, notes, and snippets.

View xlplugins's full-sized avatar

XLPlugins xlplugins

View GitHub Profile
@xlplugins
xlplugins / gist:f2815a2dd5ab9ecede7ea68ebfc84cd9
Last active December 5, 2025 14:51
Funnelkit Checkout: Change the cart Link url using Filter Hook
add_filter( 'wfacp_return_to_cart_link', function( $cart_url ) {
// Customize the cart URL
return '/shop/';
}, 10, 1 );
@xlplugins
xlplugins / gist:a72edb7288e3c2658eb6b806a50513e9
Created December 4, 2025 10:53
Funnelkit Cart: Displays minimum purchase error in FunnelKit slide cart
if ( ! class_exists( 'CT_MPAC_FKCart_Compat' ) ) {
class CT_MPAC_FKCart_Compat {
public function __construct() {
add_action( 'plugins_loaded', array( $this, 'init' ) );
}
public function init() {
// Check if both plugins are active
if ( ! class_exists( 'CtMPAC_Application' ) || ! class_exists( 'FKCart\Includes\Front' ) ) {
@xlplugins
xlplugins / gist:417b042f9c7a9be4211bb566aabc5220
Created December 4, 2025 10:11
Funnelkit Checkout: Auto-Advance Multi-Step Checkout After Smart Login
if (!class_exists('WFACP_Auto_Advance_After_Login')) {
/**
* Class WFACP_Auto_Advance_After_Login
*
* Auto-trigger the next page button after user logs in via smart login
* on specific multi-step checkout forms
*
* @since 1.0.0
*/
class WFACP_Auto_Advance_After_Login {
@xlplugins
xlplugins / gist:0a430f43365e08a030611f172b510a0d
Created December 4, 2025 07:33
Custom Quantity Increments for Specific Categories
if ( ! class_exists( 'Custom_WooCommerce_Quantity_Handler' ) ) {
/**
* Class Custom_WooCommerce_Quantity_Handler
*
* Handles custom quantity increments for WooCommerce products based on categories.
* Compatible with standard WooCommerce cart and FunnelKit Cart (slide cart).
*
* @since 1.0.0
@xlplugins
xlplugins / Paypal official invoice id format change
Created December 3, 2025 11:38
Paypal official invoice id format change
<?php
add_filter('wfocu_ppcp_gateway_invoice_id', 'modify_invoice_id_for_paypal', 10, 3);
function modify_invoice_id_for_paypal($invoice_id, $order, $prefix) {
// Get the WooCommerce order ID
$order_id = $order->get_id();
// Modify the invoice ID format to "UWC-<order_id>"
$invoice_id = 'UWC-' . $order_id;
return $invoice_id;
}
@xlplugins
xlplugins / gist:2444a4c412af5f13834169c6f39d1a39
Created December 1, 2025 12:10
FunnelKit Checkout - Aruba Fatturazione Elettronica Compatibility
if ( ! class_exists( 'WFACP_Compatibility_Aruba_Fatturazione_Elettronica' ) ) {
#[AllowDynamicProperties]
class WFACP_Compatibility_Aruba_Fatturazione_Elettronica {
/**
* Aruba field keys in correct display order
* Customer type and invoice choice first, then fiscal data heading, then tax fields
*
* @var array
*/
@xlplugins
xlplugins / gist:774beda614d6c1b2b9facb8529f9b3a7
Created December 1, 2025 11:13
Funnelkit Cart: Auto-open Funnel Kit cart when BodyCommerce AJAX add to cart completes
add_action( 'wp_footer', function () {
?>
<script>
jQuery(function($) {
$(document).ajaxComplete(function(event, jqxhr, settings) {
// Check in settings.data (POST data) for the action
if (settings && settings.data &&
settings.data.indexOf('action=bodycommerce_ajax_add_to_cart_woo') > -1 &&
jqxhr.status === 200) {
@xlplugins
xlplugins / gist:1b43aa8c036535a34699847ad3a17ec0
Created November 25, 2025 10:47
Funnelkit Checkout:Add Shipping Location for Chwazi - Delivery & Pickup Scheduling plugin
add_filter('lpac_dps_available_location_hooks', function ( $hooks ) {
$hooks['wfacp_before_shipping_calculator_field'] = __( 'Funnelkit Checkout Before Shipping Method', 'delivery-and-pickup-scheduling-for-woocommerce' );
$hooks['wfacp_after_shipping_calculator_field'] = __( 'Funnelkit Checkout After Shipping Method', 'delivery-and-pickup-scheduling-for-woocommerce' );
return $hooks;
});
@xlplugins
xlplugins / gist:6aa474ff8c09944dbce968aaa18954eb
Last active November 26, 2025 05:43
FunnelKit OrderBump Auto-Select & Cart Total Exclusion
class WFOB_Bump_Pre_Select_Fix {
/**
* OrderBump IDs to auto-select
*
* @var array
*/
private $bump_ids = array( 5503 ); // Your OrderBump IDs here in comma separated 2363, 2302, 2895
/**
@xlplugins
xlplugins / Funnelkit Checkout: Allow hyperlink in the custom fields label
Last active November 14, 2025 13:28
Funnelkit Checkout: Allow hyperlink in the custom fields label