Skip to content

Instantly share code, notes, and snippets.

View keshav1990's full-sized avatar

Keshav Kalra keshav1990

View GitHub Profile
@xlplugins
xlplugins / order before after event listener
Last active July 7, 2023 12:56
order bump before after event listener
window.addEventListener('load', function () {
wfob_frontend.hooks.addAction('wfob_before_ajax_add_order_bump', function () {
//put your code here when before order bump added to cart ajax run
});
wfob_frontend.hooks.addAction('wfob_before_ajax_remove_order_bump', function () {
//put your code here when before order bump remove item from cart ajax run
});
@xlplugins
xlplugins / gist:94d3a81085fbc3553d9e03cd7187cb2a
Created March 6, 2023 12:40
Display Multiple country for specific checkout pages
class WFACP_Multiple_Country_Multilple_Checkout {
private $country = [
'DE',
'GB',
];
private $checkout_ids = [
'384387',
'384341',
];
@xlplugins
xlplugins / define is cart in ajax for min max plugin CodeAstrology Team
Last active August 21, 2023 12:50
define is cart in ajax for min max plugin CodeAstrology Team
class Fkcart_Min_Max_Snippet {
public function __construct() {
add_filter( 'woocommerce_quantity_input_args', [ $this, 'define_cart' ], - 1 );
}
public function define_cart($args) {
if ( wp_doing_ajax() ) {
wc_maybe_define_constant( 'WOOCOMMERCE_CART', true );
}
return $args;
@xlplugins
xlplugins / allow funnelkit cart on Sales landing page
Last active July 7, 2023 12:57
allow funnelkit cart on sales landing page #cart
add_filter( 'fkcart_disabled_post_types', function ( $post_types ) {
$post_types=array_filter( $post_types, function ( $i ) {
return $i != 'wffn_landing';
} );
return $post_types;
} );
@xlplugins
xlplugins / firing different pixels per language
Last active May 28, 2025 08:44
firing different pixels per language
class FunnelKit_Multiple_Pixel {
public function __construct() {
// Liste des hooks groupés par type
$this->add_filters( [
// Facebook Pixel ID
'wfocu_fb_pixel_ids',
'bwf_fb_pixel_ids',
'wfacp_fb_pixel_ids'
], 'get_fb_pixel_id' );
@xlplugins
xlplugins / FUnnelkit datalogic Hidden Field Snippet
Created April 28, 2023 07:20
FUnnelkit datalogic Hidden Field Snippet
add_action('wfacp_after_checkout_form_fields', function (){
?>
<input type="hidden" name="datalogics_n_code" id="datalogics_n_code" value="" form="wfacp_checkout_form">
<input type="hidden" name="datalogics_n_code_platform_id" id="datalogics_n_code_platform_id" value="" form="wfacp_checkout_form">
<?php
});
@xlplugins
xlplugins / Do not run update order review on last step
Created May 8, 2023 15:24
Do not run update order review on last step
add_action( 'wfacp_internal_css', function () {
?>
<style>
body #payment.wfacp_enable_loader .blockUI {
display: block !important;
}
</style>
<script>
window.addEventListener('load', function () {
if (undefined !== wfacp_frontend) {
@xlplugins
xlplugins / Display VAT (TVA )Custom field on checkout for WholeSale User
Created May 9, 2023 11:08
Display VAT (TVA )Custom field on checkout for WholeSale User
class WFACP_woocommerce_checkout_fields {
public $new_fields = [];
public function __construct() {
/* Create Advance Field */
add_filter( 'wfacp_advanced_fields', [ $this, 'add_fields' ] );
add_filter( 'wfacp_forms_field', [ $this, 'hide_field' ], 99, 2 );
}
@xlplugins
xlplugins / css
Created May 31, 2023 07:06
untitled
add_action( 'wp_head', function () {
?>
<style>
body.single-product .mfp-wrap, .mfp-bg {
display: none
}
body.single-product a.added_to_cart.wc-forward {
display: none;
}
@xlplugins
xlplugins / Fetchify Address Autocomplete
Last active June 4, 2025 11:30
Fetchify Address Autocomplete
class WFACP_Fetchify{
public function __construct() {
add_action('wfacp_before_form',[$this, 'add_fields']);
add_filter( 'wfacp_internal_css', [ $this, 'add_css_js' ] );
}
public function add_fields() {
$instance=WFACP_Common::remove_actions('woocommerce_checkout_billing','WC_ClickToAddress_Autocomplete_Integration','addCheckoutJs');
if($instance instanceof WC_ClickToAddress_Autocomplete_Integration){
add_action('woocommerce_before_checkout_form',[$instance,'addCheckoutJs']);