Skip to content

Instantly share code, notes, and snippets.

View keshav1990's full-sized avatar

Keshav Kalra keshav1990

View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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 / 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 / remove extra checkout js from funnelkit checkout
Created July 24, 2023 12:24
remove extra checkout js from funnelkit checkout
add_action( 'wp_footer', function () {
/**
* Uncomment Below two line of code if you not used variable product in checkout
*/
//wp_dequeue_script( 'wc-single-product' );
//wp_dequeue_script( 'wc-add-to-cart-variation' );
@xlplugins
xlplugins / move billing address section (any section ) below the gateway
Last active August 17, 2023 06:49
move billing address section (any section ) below the gateway
/**
this snippet Work only if funnel builder 2.13 or Greater and AeroCheckout 3.8.1 or Greater
*/
class FunnelKitMoveSectionBelowGateway {
private $contained_section_fields = [ 7 => ''];
public function __construct() {
add_action( 'wfacp_internal_css', [ $this, 'css' ] );
@xlplugins
xlplugins / converios track on funnelkit cart open
Created August 1, 2023 13:01
converios track on funnelkit cart open
add_action( 'wp_footer', function () {
?>
<script>
window.addEventListener('load', function () {
jQuery('body').on('fkcart_open', function () {
(function (a, b) {
a = "https://log.superceramiccoating.com/conversion.js?cid={clickid}&et=add_to_cart";
var c = b.createElement("script"), d = b.scripts[0];
if (b = b.cookie.match(/(^| )vl-cid=([^;]+)/)) if (-1 < a.indexOf("cid=")) a = a.replace(/cid=.*?(&|$)/, "cid=" + b.pop() + "&"); else {
var e = -1 < a.indexOf("?") ? "&" : "?";