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
| /** | |
| * TEMP DIAGNOSTIC — check Mollie mandates for a given order's customer right now. | |
| * Run on the LIVE site as an admin: /wp-admin/?fk_check_mandate=5644 | |
| * Remove after testing. | |
| */ | |
| add_action( 'admin_init', function () { | |
| if ( ! isset( $_GET['fk_check_mandate'] ) || ! current_user_can( 'manage_woocommerce' ) ) { | |
| 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
| /** | |
| * Relocate billing_company / shipping_company on FunnelKit Checkout — | |
| * ONLY on the checkout IDs you list below. | |
| */ | |
| add_filter( 'wfacp_get_fieldsets', function ( $fieldsets ) { | |
| /* ---- EDIT THIS ---------------------------------------------------- | |
| * 1) Which checkouts should this run on? Put their checkout IDs here. | |
| * Find the ID in the editor URL: admin.php?page=wfacp&wfacp_id=123 | |
| */ |
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
| /** | |
| * Modify WFOCU cron schedule interval from 4 minutes to 20 minutes. | |
| * | |
| * The plugin registers a custom cron schedule 'wfocu_cron_schedule_times' at 4-minute | |
| * intervals. This filter runs at priority 10000 (after WFOCU's own registration) to | |
| * override the interval. The change takes effect on the next execution of the | |
| * 'fk_fb_every_4_minute' event without requiring a manual reschedule. | |
| */ | |
| add_filter( 'cron_schedules', function( $schedules ) { | |
| if ( isset( $schedules['wfocu_cron_schedule_times'] ) ) { |
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 ( ! class_exists( 'WFACP_Session_Guard' ) ) { | |
| class WFACP_Session_Guard { | |
| private static $instance = null; | |
| public static function get_instance() { | |
| if ( null === self::$instance ) { | |
| self::$instance = new self(); | |
| } |
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_footer', function() { | |
| if ( ! is_product() && ! is_cart() && ! is_checkout() ) { | |
| return; | |
| } | |
| ?> | |
| <script> | |
| document.addEventListener('DOMContentLoaded', function() { | |
| if (!document.getElementById('kec-pay-button')) { | |
| var el = document.createElement('div'); | |
| el.id = 'kec-pay-button'; |
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( 'woocommerce_before_calculate_totals', function ( $cart ) { | |
| if ( ! $cart instanceof WC_Cart || $cart->is_empty() ) { | |
| return; | |
| } | |
| $contents = $cart->cart_contents; | |
| if ( count( $contents ) < 2 ) { | |
| 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
| add_filter( 'wfocu_show_default_variation_on_load', '__return_false' ); |
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 ) { | |
| if ( is_null( WC()->cart ) ) { | |
| return false; | |
| } | |
| $location = WC_Geolocation::geolocate_ip( '', true, true ); | |
| $country = ! empty( $location['country'] ) ? strtoupper( $location['country'] ) : ''; | |
| if ( 'AU' !== $country ) { |