Skip to content

Instantly share code, notes, and snippets.

View keshav1990's full-sized avatar

Keshav Kalra keshav1990

View GitHub Profile
@xlplugins
xlplugins / Multiple order submit printed on checkout page germanized
Created November 15, 2022 06:50
Multiple order submit printed on checkout page germanized
add_action( 'wfacp_checkout_before_order_review', function () {
remove_action( 'woocommerce_checkout_order_review', 'woocommerce_gzd_template_order_submit', wc_gzd_get_hook_priority( 'checkout_order_submit' ) );
} );
@xlplugins
xlplugins / temperory-snipper
Created November 24, 2022 15:53
temperory-snipper
window.addEventListener('bwf_checkout_load', function () {
let form_attributes = $("input[form='wfacp_checkout_form']");
form_attributes.each(function () {
$(this).attr('form', 'checkout');
});
});
@xlplugins
xlplugins / if_checkout_overriden_by_store_checkout.php
Created November 25, 2022 07:37
If checkout overridden by store checkout funnel
<?php
function if_funnel_has_store_checkout_set() {
if ( ! class_exists( 'WFFN_Common' ) || ! method_exists( 'WFFN_Common', 'get_store_checkout_id' ) || 0 === WFFN_Common::get_store_checkout_id() ) {
return false;
}
$funnel = new WFFN_Funnel( WFFN_Common::get_store_checkout_id() );
/**
@xlplugins
xlplugins / custom script
Created December 2, 2022 11:31
untitled
<script>
(function () {
window.addEventListener('bwf_checkout_js_load', function () {
jQuery(document).ajaxComplete(function (event, jqxhr, settings) {
if (settings.url.indexOf("admin-ajax") > -1 && settings.hasOwnProperty('data') && settings.data.indexOf('wcpt_add_to_cart_multi')) {
jQuery.scroll_to_notices(jQuery('#wfacp_checkout_form'))
}
});
});
})();
@xlplugins
xlplugins / gist:d0e63312790c0b7a45078a7a50c17970
Created December 13, 2022 13:15
pre select order bump not specific bump id
add_action( 'wp_footer', function () {
?>
<script>
window.addEventListener('bwf_checkout_load', function () {
(function ($) {
var bump_all_added = false;
var first_click = false;
wfob_frontend.hooks.addFilter('wfob_before_ajax_data_add_order_bump', set_custom_data);
@xlplugins
xlplugins / Offer_vlidation_custom.php
Created January 2, 2023 08:09
offer validation custom
add_filter( 'wfocu_offer_validation_result', function ( $result, $offer_build ) {
if ( false === $result ) {
return $result;
}
$get_order = WFOCU_Core()->data->get_parent_order();
$yourcondition = false;
/**
@xlplugins
xlplugins / Unset Payment gatewy for specific checkout page
Created February 7, 2023 07:55
Unset Payment gatewy for specific checkout page- for client
<?php
class WFACP_TEMP_001 {
public function __construct() {
add_action( 'wfacp_before_process_checkout_template_loader', [ $this, 'actions' ] );
}
public function actions() {
add_filter( 'woocommerce_available_payment_gateways', [ $this, 'unset_payment_gatway' ] );
}
@xlplugins
xlplugins / gist:8cebd4b145620e7eeda69a253e2da04b
Last active July 7, 2023 12:56
Display Html According To product add to cart in funnelkit checkout
class WFACP_Display_Product_Html_by_Id {
private $product_ids = [];
private $selected_product = 0;
private $display_products = [
564,
1474,
];
@xlplugins
xlplugins / gist:4158b69e9bffb5c8972a9e2f2abdaafe
Last active July 7, 2023 12:56
Trigger Update checkout in funnelkit checkout multi step final step
add_action( 'wfacp_internal_css', function () {
?>
<style>
#payment ul li div.payment_box {
display: none;
}
#payment ul li:first-child div.payment_box{
display:block;
}
@xlplugins
xlplugins / gist:13080af3302571fee7f44e74a9966000
Created March 1, 2023 10:39
billing Shipping Phone Field Masking
class WFACP_billing_Phone_Field_Masking {
private $fields=['billing_phone','shipping_phone'];
public function __construct() {
add_filter( 'woocommerce_form_field_args', [ $this, 'add_default_styling' ], 10, 2 );
add_action( 'wp_footer', [ $this, 'internal_css_js' ] );
}