Skip to content

Instantly share code, notes, and snippets.

View keshav1990's full-sized avatar
🏠
Open For Remote Jobs

Keshav Kalra keshav1990

🏠
Open For Remote Jobs
View GitHub Profile
@xlplugins
xlplugins / Add Fake Element on funnelkit checkout - WooReward plugin
Last active October 26, 2023 08:09
Add Fake Element on funnelkit checkout - WooReward plugin
class WFACP_Cart_FAKE_Element {
public function __construct() {
add_action( 'wfacp_outside_header', [ $this, 'action' ] );
add_action( 'wfacp_internal_css', [ $this, 'internal_js' ] );
}
public function is_enable() {
$is_global_checkout = WFACP_Core()->public->is_checkout_override();
@xlplugins
xlplugins / BUMp:Disable country based pricing compatibility file
Created October 19, 2023 15:11
BUMp:Disable country based pricing compatibility file
add_action( 'woocommerce_after_calculate_totals', function () {
if ( ! class_exists( 'WFOB_Product_Price_Based_Country' ) ) {
return;
}
WFOB_Common::remove_actions( 'wfob_product_raw_data', 'WFOB_Product_Price_Based_Country', 'change_price_data' );
} );
@xlplugins
xlplugins / display strike-through price for cart item subtotal
Last active August 31, 2023 16:38
display strike-through price for cart item subtotal
class Fkcart_Cart_item_cut_Price {
public function __construct() {
add_action( 'fkcart_after_header', [ $this, 'attach_action' ] );
}
public function attach_action() {
add_filter( 'woocommerce_cart_item_subtotal', [ $this, 'display_strike_price' ], 999, 2 );
}
public function display_strike_price( $price, $cart_item ) {
@keshav1990
keshav1990 / SmartButtons at step 2
Created August 17, 2023 06:52 — forked from xlplugins/SmartButtons at step 2
Funnelkit checkout SmartButtons at positions
add_filter( 'wfacp_smart_buttons_positions', function ( $settings ) {
$settings[] = [ 'id' => 'woocommerce_review_order_after_payment', 'name' => 'bottom of gateway lists' ];
return $settings;
} );
@xlplugins
xlplugins / prevent_fb_analytics_on_checkout.php
Last active September 13, 2023 08:08
This snippet will deque FB analytics js file and prevent any ajax requests on checkout page
/**
* This snippet will deque FB analytics js file and prevent any ajax requests on checkout page
*/
add_action( 'wp_enqueue_scripts', function () {
global $post;
if ( 0 < did_action( 'wfacp_checkout_page_found' ) && 'XXXXX' == $post->ID ) {
remove_action( 'wp_enqueue_scripts', array( WFFN_Core()->public, 'maybe_add_script' ) );
}
@xlplugins
xlplugins / Custom position in for funnelkit stripe plugin
Created August 7, 2023 13:41
Custom position in for funnelkit stripe plugin
add_filter('fkwcs_express_button_checkout_position',function (){
return 'woocommerce_review_order_after_payment';
},30);
@xlplugins
xlplugins / php field validation on checkout page
Last active September 13, 2023 08:08
php field validation on checkout page
add_filter( 'wfacp_checkout_fields', 'ocultar_validar_cuit_cuilde_ar', 20 );
function ocultar_validar_cuit_cuilde_ar( $fields ) {
// Verificar si el país seleccionado es Argentina (código de país: AR)
if ( isset( $_POST['billing_country'] ) && $_POST['billing_country'] !== 'AR' ) {
// Deshabilitar la validación del campo 'billing_cuitcuil'
$fields['advanced']['billing_cuitcuil']['required'] = false;
}
return $fields;
@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("?") ? "&" : "?";
@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 / 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' );