Skip to content

Instantly share code, notes, and snippets.

View keshav1990's full-sized avatar

Keshav Kalra keshav1990

View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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 / 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 / Disable all shimmer until at time of load. Reactivated when user perform any action (Form change,Mini Cart )
Last active July 7, 2023 12:57
Disable all shimmer until at time of load. Reactivated when user perform any action (Form change,Mini Cart )
add_action( 'wfacp_internal_css', function () {
?>
<style>
body .wfacp_pro_switch.wfacp_animation_start .wfacp-pro-thumb:after,
body .wfacp_pro_switch.wfacp_animation_start .product-name .wfacp_product_switcher_item:after,
body .wfacp_pro_switch.wfacp_animation_start .product-name .wfacp_product_name_inner > span:after,
body .wfacp_pro_switch.wfacp_animation_start .wfacp_pro_attr_single:after,
body .wfacp_pro_switch.wfacp_animation_start .wfacp_product_subs_details span:after,
body .wfacp_pro_switch.wfacp_animation_start .product-name .wfacp_product_select_options a:after,
body .wfacp_pro_switch.wfacp_animation_start .wfacp_quantity .wfacp_qty_wrap:after,
@xlplugins
xlplugins / Express button load faster
Created September 28, 2022 07:57
Express button load faster
add_action( 'wfacp_run_checkout_event', function () {
?>
<script>
window.addEventListener('bwf_checkout_js_load', function () {
wfacp_frontend.hooks.addFilter('wfacp_run_checkout_event', function () {
return 'dom';
});
});
add_filter('wfacp_order_summary_column_item_heading',function (){
return 'Item';
});
add_filter('wfacp_order_summary_column_total_heading',function (){
return 'Amount';
});