Skip to content

Instantly share code, notes, and snippets.

View xlplugins's full-sized avatar

XLPlugins xlplugins

View GitHub Profile
@xlplugins
xlplugins / Hide autoship option for non subscription product
Created June 23, 2025 14:37
Hide autoship option for non subscription product
add_filter( 'fkcart_select_options_label', function ( $text, $cart_item ) {
if ( ! ( isset( $cart_item['cart_item']['bos4w_data'] ) && ! empty( $cart_item['cart_item']['bos4w_data']['selected_subscription'] ) ) ) {
$text = '';
}
return $text;
} ,11,2);
@xlplugins
xlplugins / Checkout: compatability with HFD ePost Integration by HFD
Created June 18, 2025 14:52
Checkout: compatability with HFD ePost Integration by HFD
add_action( 'wfacp_internal_css', function () {
if(!class_exists('\Hfd\Woocommerce\Container')){
return;
}
$helper = \Hfd\Woocommerce\Container::get('Hfd\Woocommerce\Helper\Spot');
?>
<script>
window.addEventListener('load', function () {
(function ($) {
@xlplugins
xlplugins / Dequeue_wp_forms_js_on_optin.php
Created June 17, 2025 10:57
Dequeue_wp_forms_js_on_optin
/**
* Dequeues the `wpforms-smart-phone-field` script on optin pages.
*
* This function hooks into the `wp_enqueue_scripts` action and checks if the current page
* is an optin page using the `WFFN_Optin_Pages` class. If the page is an optin page, it
* removes the `wpforms-smart-phone-field` script from the queue.
*
* @hook wp_enqueue_scripts
* @priority 20
*/
@xlplugins
xlplugins / run update checkout on product switcher event
Created June 16, 2025 14:10
run update checkout on product switcher event
class WFOB_Compatibility_Re_run_update_review {
private $process = false;
public function __construct() {
add_action( 'wp_footer', [ $this, 'js' ] );
add_action( 'woocommerce_checkout_update_order_review', [ $this, 'get_data' ], 5 );
add_filter( 'woocommerce_update_order_review_fragments', [ $this, 'unset_fragments' ], 900 );
}
@xlplugins
xlplugins / Enable Customizer css on Funnelkit Checkout
Created June 13, 2025 13:40
Enable Customizer css on Funnelkit Checkout
class WFACP_EnableCustomizerCss {
public function __construct() {
add_action( 'wfacp_after_checkout_page_found', [ $this, 'run_hook' ] );
}
public function run_hook() {
add_filter( 'wfacp_enable_customizer_css', '__return_false' );
}
}
@xlplugins
xlplugins / enable_cart_on_optin.php
Created June 13, 2025 06:00
Enable cart on optin pages
add_filter( 'fkcart_disabled_post_types', function ( $post_types ) {
$post_types=array_filter( $post_types, function ( $i ) {
return $i != 'wffn_optin';
} );
return $post_types;
} );
@xlplugins
xlplugins / Disable Animation on Slide cart during add to cart and click on ICON
Created June 12, 2025 15:03
Disable Animation on Slide cart during add to cart and click on ICON
add_filter('fkcart_re_run_get_slide_cart_ajax','__return_false',99);
add_action( 'wp_footer', function () {
?>
<style>
.fkcart-drawer-container {
transform: translate(0px) !important;
}
</style>
<script>
@xlplugins
xlplugins / open fast slide cart using customerscript
Last active June 11, 2025 08:30
open fast slide cart using customerscript
add_action( 'wp_footer', function () {
?>
<script>
(function () {
$ = jQuery;
$(document.body).on('fkcart_cart_closed', function (params) {
console.log('update')
$('#fkcart-modal').slideUp()
});
@xlplugins
xlplugins / fk_optin_admin_notification_subject.php
Created June 10, 2025 15:16
fk_optin_admin_notification_subject
add_action('fk_optin_admin_notification_subject', function() {
return 'You got a new email from funnel builder optin';
},99);
@xlplugins
xlplugins / wc_auto_complete.php
Created June 10, 2025 13:19
Autocomplete Woo order
add_filter( 'woocommerce_payment_complete_order_status', 'wc_auto_complete_paid_order', 10, 3 );
function wc_auto_complete_paid_order( $status, $order_id, $order ) {
return 'completed';
}