Skip to content

Instantly share code, notes, and snippets.

View keshav1990's full-sized avatar

Keshav Kalra keshav1990

View GitHub Profile
@xlplugins
xlplugins / volumm_script_with_clickid.php
Created July 17, 2023 12:21
Voluum script with click ID
/**
* Rendering Custom tracking script for thank you and upsell pages.
*
* @param $general_data
*/
function render_custom_script_tracking( $general_data ) {
?>
<script type="text/javascript">
if (undefined !== wfocu_tracking_data && '' !== wfocu_tracking_data) {
@xlplugins
xlplugins / Show custom fields below the gateway
Last active August 24, 2023 16:54
Show custom fields below the gateway
class WFACP_CustomFields_Inside_Gateway {
private $hook = 'woocommerce_checkout_after_terms_and_conditions';
private $hook_priority = 10;
private $collected_fields = [];
public function __construct() {
add_action( $this->hook, [ $this, 'display_fields' ], $this->hook_priority );
@xlplugins
xlplugins / trigger submit button by custom buttom
Created July 12, 2023 08:31
trigger submit button by custom buttom
if ( ! class_exists( 'Custom_place_order_button_Count' ) ) {
class Custom_place_order_button_Count {
private static $instance = null;
public static function get_instance() {
if ( is_null( self::$instance ) ) {
self::$instance = new self();
}
@xlplugins
xlplugins / disabled aero scrolling
Created July 7, 2023 11:35
disabled aero scrolling
add_action( 'wfacp_after_form', function () {
?>
<script>
window.addEventListener('bwf_checkout_js_load',function (){
jQuery.wfacp_step_scrolling= function (scrollElement) {};
wfacp_frontend.hooks.addFilter('wfacp_switch_steps_need_update_checkout',function (){
return false;
});
});
@xlplugins
xlplugins / Add a new column for UTM Source in WooCommerce order listing page
Last active May 17, 2024 13:17
Add a new column for UTM Source in WooCommerce order listing page
// ADDING 2 NEW COLUMNS WITH THEIR TITLES (keeping "Total" and "Actions" columns at the end)
add_filter( 'manage_edit-shop_order_columns', 'wffn_custom_shop_order_column', 22 );
add_filter( 'woocommerce_shop_order_list_table_columns', 'wffn_custom_shop_order_column', 22 );
function wffn_custom_shop_order_column( $columns ) {
$reordered_columns = array();
// Inserting columns to a specific location
foreach ( $columns as $key => $column ) {
$reordered_columns[ $key ] = $column;
if ( $key == 'billing_address' ) {
@xlplugins
xlplugins / gist:9576e2dbb6143cc297ac36d251611ee4
Created June 23, 2023 14:24
Trigger Update order review after page load
add_action( 'wfacp_internal_css', function () { ?>
<script>
window.addEventListener('bwf_checkout_load', function () {
(function ($) {
setTimeout(function(){
$(document.body).trigger('update_checkout');
},1000);
@xlplugins
xlplugins / custom_fkwcs_order_processing_on_webhook.php
Last active September 6, 2023 17:04
Stripe webhook custom processing order
/**
* attaching the single schedule action on webhook event
* this will take care of few edge cases where we have the stripe payment went through fine but in wc no activity shows up
*/
add_action( 'fkwcs_webhook_event_intent_succeeded', function ( $charge, $order ) {
if ( as_has_scheduled_action( 'fkwcs_custom_single_order', [ 'order' => $order->get_id() ] ) ) {
return;
}
@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']);
@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 / 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 );
}