Skip to content

Instantly share code, notes, and snippets.

View sandeepwisetr's full-sized avatar

Sandeep soni sandeepwisetr

View GitHub Profile
@sandeepwisetr
sandeepwisetr / fatal error resolve when page editing with beaver builder elementor is present
Created September 5, 2022 12:43
fatal error resolve when page editing with beaver builder elementor is present
add_action( 'wfacp_after_checkout_page_found', function () {
if ( WFACP_Common::is_customizer() ) {
return;
}
$page_design = WFACP_Common::get_page_design( WFACP_Common::get_id() );
if ( 'embed_forms' == $page_design['selected_type'] ) {
if ( ! WFACP_Common::is_customizer() ) {
add_filter( 'wfacp_embed_form_allow_header', '__return_false' );
return;
@sandeepwisetr
sandeepwisetr / sidebar.php
Created November 30, 2020 16:10
Show Recurring detail in sidebar
<?php
add_filter('wfacp_disable_subscriptions_sidebar_summary','__return_false',99);
@sandeepwisetr
sandeepwisetr / remove_customizer_css.php
Created March 3, 2020 12:00
remove customizer css
<?php
add_action( 'wp_head', function () {
if ( class_exists( 'wfacp_core' ) ) {
if ( did_action( 'wfacp_after_checkout_page_found' ) ) {
$instance = WFACP_Core()->customizer->get_template_instance();
remove_action( 'wfacp_header_print_in_head', [ $instance, 'add_style_inline' ] );
remove_action( 'wfacp_header_print_in_head', [ $instance, 'typography_custom_css' ] );
}
}
} );
@sandeepwisetr
sandeepwisetr / remove_customizer_css.php
Created March 3, 2020 12:00
remove customizer css
<?php
add_action( 'wp_head', function () {
if ( class_exists( 'wfacp_core' ) ) {
if ( did_action( 'wfacp_after_checkout_page_found' ) ) {
$instance = WFACP_Core()->customizer->get_template_instance();
remove_action( 'wfacp_header_print_in_head', [ $instance, 'add_style_inline' ] );
remove_action( 'wfacp_header_print_in_head', [ $instance, 'typography_custom_css' ] );
}
}
} );
@sandeepwisetr
sandeepwisetr / remove_customizer_css.php
Created March 3, 2020 12:00
remove customizer css
<?php
add_action( 'wp_head', function () {
if ( class_exists( 'wfacp_core' ) ) {
if ( did_action( 'wfacp_after_checkout_page_found' ) ) {
$instance = WFACP_Core()->customizer->get_template_instance();
remove_action( 'wfacp_header_print_in_head', [ $instance, 'add_style_inline' ] );
remove_action( 'wfacp_header_print_in_head', [ $instance, 'typography_custom_css' ] );
}
}
} );
@sandeepwisetr
sandeepwisetr / snippets.php
Created February 17, 2020 12:09
Site specific issue [watchvice.de] [7054358]
add_action( 'wfacp_after_checkout_page_found', function () {
add_action( 'wp_footer', function () { ?>
<script>
window.addEventListener('load', function () {
var do_not_run = false;
$(document.body).on('updated_checkout', function () {
if ($('#woo_pp_ec_button_checkout .paypal-button').length == 0 && $('#payment_method_ppec_paypal').length == 1) {
$('input[name="payment_method"]:checked').click();
}
});
@sandeepwisetr
sandeepwisetr / fluxair.php
Created February 7, 2020 09:28
This snippet belong to fluxair site
add_action( 'wfacp_before_process_checkout_template_loader', function () {
add_filter( 'woocommerce_no_shipping_available_html', function ( $message ) {
if ( 39648 !== WFACP_Common::get_id() ) {
return $message;
}
$packages = WC()->shipping()->get_packages();
$postcode = $_REQUEST['s_postcode'];
if ( count( $packages['rates'] ) == 0 && '' == $postcode ) {
return WFACP_Common::default_shipping_placeholder_text();
@sandeepwisetr
sandeepwisetr / update_order_review_page_load.js
Created February 6, 2020 11:32
Update order review not running due to woocommerce 3.9
window.addEventListener('load',function(){
jQuery('body').trigger('update_checkout');
});
@sandeepwisetr
sandeepwisetr / sold.php
Created February 3, 2020 11:07
resolve conflict with aero and sold indivisually product
<?php
add_filter('wfacp_restrict_sold_individual_checkout','__return_false');
@sandeepwisetr
sandeepwisetr / allow-all-type-product-slip-cart.php
Created January 29, 2020 05:26
Allow All type of product in skip cart
<?php
add_filter( 'wfch_offer_product_types', function () {
return array(
'simple',
'variable',
'course',
'variation',
'subscription',
'variable-subscription',