This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'woocommerce_package_rates', 'wfacp_force_free_shipping_on_funnel_pages', 100, 2 ); | |
| /** | |
| * Filter shipping rates to force free shipping on target FunnelKit checkout pages. | |
| * | |
| * @param array $rates Available shipping rates. | |
| * @param array $package Shipping package data. | |
| * | |
| * @return array Filtered shipping rates. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'fkcart_free_shipping', function ( $options ) { | |
| // Ensure $options is an array. | |
| if ( false === $options ) { | |
| $options = []; | |
| } | |
| // Get current store/order currency (works with multi-currency plugins that hook into WooCommerce). | |
| $currency = get_woocommerce_currency(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /**FunnelKit - trust_section on wfacp_after_gateway_list */ | |
| if ( ! defined( 'ABSPATH' ) ) { | |
| exit; | |
| } | |
| const WFACP_TRUST_ID = 'trust_section'; | |
| add_action( 'wfacp_after_template_found', function () { | |
| static $d = false; | |
| if ( $d || ! class_exists( 'WFACP_Common' ) || ! function_exists( 'wfacp_form_field' ) ) { | |
| return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if ( ! function_exists( 'checkout_phone_local_zero_normalize_one' ) ) { | |
| function checkout_phone_local_zero_normalize_one( $phone ) { | |
| if ( ! is_string( $phone ) || $phone === '' ) { | |
| return $phone; | |
| } | |
| $p = trim( $phone ); | |
| $p = str_replace( array( ' ', "\t", "\n", "\r", '-', '(', ')' ), '', $p ); | |
| if ( $p === '' ) { | |
| return $phone; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Create_Confirm_Email_Field { | |
| public $email_required_msg = ''; | |
| public $email_not_matched = ''; | |
| public $display_page = false; | |
| public function __construct() { | |
| // Run this feature only for guest users | |
| if ( is_user_logged_in() ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action( 'wp_enqueue_scripts', function() { | |
| if ( ! apply_filters( 'fkcart_prevent_cart_reload', true ) ) { | |
| return; | |
| } | |
| if ( is_cart() ) { | |
| return; | |
| } | |
| $inline = <<<'JS' | |
| (function($){ | |
| $(document).on('added_to_cart.wc-cart wc_update_cart.wc-cart', function(e){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action( 'wp_enqueue_scripts', function() { | |
| if ( ! apply_filters( 'fkcart_prevent_cart_reload', true ) ) { | |
| return; | |
| } | |
| if ( is_cart() ) { | |
| return; | |
| } | |
| $inline = <<<'JS' | |
| (function($){ | |
| $(document).on('added_to_cart.wc-cart wc_update_cart.wc-cart', function(e){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * FunnelKit checkout: replace post in theme loop so FunnelKit checkout content is used. | |
| * When template is "theme", page.php runs have_posts/the_post with the default WooCommerce checkout page. | |
| * This replaces $post with the FunnelKit checkout post so the_content() outputs the correct form. | |
| */ | |
| add_action( 'lebagol_page', function() { | |
| if ( ! function_exists( 'is_checkout' ) || ! is_checkout() ) { | |
| return; | |
| } | |
| if ( ! class_exists( 'WFACP_Common' ) ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Plugin Name: FunnelKit + Automatic CSS Checkout Fix | |
| * Description: Disables Automatic CSS on FunnelKit checkout. Add to mu-plugins. | |
| * | |
| * Automatic CSS uses a custom Style_Queue (not wp_styles), so wp_dequeue_style() has no effect. | |
| * The only way is to remove its wp_head callback. We find it by class and unset directly | |
| * since remove_action requires the exact object reference. | |
| */ | |
| add_action( 'template_redirect', 'funnelkit_disable_automaticcss_on_checkout', 1 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Plugin Name: FunnelKit + Automatic CSS Checkout Fix | |
| * Description: Disables Automatic CSS on FunnelKit checkout. Add to mu-plugins. | |
| * | |
| * Automatic CSS uses a custom Style_Queue (not wp_styles), so wp_dequeue_style() has no effect. | |
| * The only way is to remove its wp_head callback. We find it by class and unset directly | |
| * since remove_action requires the exact object reference. | |
| */ | |
| add_action( 'template_redirect', 'funnelkit_disable_automaticcss_on_checkout', 1 ); |
NewerOlder