Skip to content

Instantly share code, notes, and snippets.

View xlplugins's full-sized avatar

XLPlugins xlplugins

View GitHub Profile
@xlplugins
xlplugins / FunnelKit - ACF integration
Created June 7, 2025 14:30
FunnelKit - ACF integration
class WFACP_ACF_Custom_Fields {
private static $ins = null;
private $fields_label = [
'field_663d53424eeb3' => [
'label' => 'How did you hear about us?',
'id' => 'how_did_you_hear_about_us_copy',
],
'field_663d5100cb98f' => [
'label' => 'What is your role?',
@xlplugins
xlplugins / Save log for during the checkout process for checking Subscription created?.
Created June 7, 2025 12:33
Save log for during the checkout process for checking Subscription created?.
class Funnekit_Save_log_Subscription_function_runs {
public function __construct() {
add_action( 'woocommerce_checkout_process', [ $this, 'log_subscription' ] );
add_action( 'woocommerce_checkout_order_processed', array( $this, 'log_subscription' ), 101 );
add_action( 'subscriptions_created_for_order', array( $this, 'log_subscription' ), 101 );
add_action( 'woocommerce_checkout_subscription_created', array( $this, 'log_subscription' ), 101 );
}
public function log_subscription( $order = null ) {
try {
@xlplugins
xlplugins / forcefully create subscription
Last active June 6, 2025 14:00
forcefully create subscription
<?php
class Funnelkit_Force_Create_Subscription {
public function __construct() {
add_action( 'woocommerce_checkout_process', [ $this, 'attach_dependant_hooks' ] );
}
/**
* Attach order meta update hook during checkout.
@xlplugins
xlplugins / prevent_lead_event_on_specific_pages.php
Created June 6, 2025 08:45
prevent_lead_event_on_specific_pages.php
/**
* Controls tracking JavaScript output for optin pages
*
* Disables tracking JS by default and only enables it for specific optin page IDs.
* Used to selectively enable tracking on certain optin pages while keeping it disabled
* for all others.
*
* @since 2.0.0
* @param bool $bool Whether to allow tracking JS output
* @return bool Modified boolean value
@xlplugins
xlplugins / Show WooCommerce In built cart-item-data.php inside the Funnelkit Slide Cart
Created June 5, 2025 11:44
Show WooCommerce In built cart-item-data.php inside the Funnelkit Slide Cart
add_filter('fkcart_use_buit_in_cart_item_data_template','__return_false');
@xlplugins
xlplugins / gist:5e30a94d0f7303344b73fa8c51203ead
Created June 5, 2025 11:16
Funnelkit Cart: Template mela variation swatches Conflict
class FKCART_TemplateMela {
public function __construct() {
add_action( 'fkcart_quick_before_view_content', [ $this, 'remove_action' ] );
}
public function is_enable() {
return function_exists('bt_variation_swatches_attribute_options');
}
@xlplugins
xlplugins / Checkout: City, state, postcode label translate based on checkout page IDs
Created June 5, 2025 07:30
Checkout: City, state, postcode label translate based on checkout page IDs
class WFACP_Change_City_State_Postcode_fields {
protected $labels = [];
protected $id = [9883]; // can multiple with comma saperated xxx,yyy
public function __construct() {
@xlplugins
xlplugins / show customer shipping or billing into checkout fields
Created June 4, 2025 14:50
show customer shipping or billing into checkout fields
add_filter( 'woocommerce_form_field_args', function ( $args, $key, $value ) {
$args['custom_attributes']['data-profile'] = $value;
return $args;
}, 20, 3 );
add_action( 'wp_footer', function () {
if ( ! is_user_logged_in() ) {
return;
}
@xlplugins
xlplugins / Checkout: Movable Klaviyo field
Created June 4, 2025 06:14
Checkout: Movable Klaviyo field
class WFACP_Move_Detect_Extra_Fields {
public function __construct() {
add_filter( 'wfacp_advanced_fields', [ $this, 'add_fields' ] );
}
public function add_fields( $field ) {
$field['billing_wc_custom_field'] = [
@xlplugins
xlplugins / gist:bfaeabdcc7f51b005ea5c1009ce9b3b4
Last active June 4, 2025 08:16
Funnelkit Cart: WP Loyality reward points add Rewards Notice after Header of funnelkit cart
add_action('fkcart_after_header',function(){
echo do_shortcode('[wlr_cart_earn_message]');
});