Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the simple-custom-post-order domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/staging.wpify.io/web/wp/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the woocommerce domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/staging.wpify.io/web/wp/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the woocommerce-subscriptions domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/staging.wpify.io/web/wp/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wpify-woo domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/staging.wpify.io/web/wp/wp-includes/functions.php on line 6114
Vlastní úpravy pomocí funkcí a snippetů – WPify

Dokumentace

Vlastní úpravy pomocí funkcí a snippetů

V modulu je několik připravených hooků na které lze připravit vlastní funkce.

Zobrazení notifikace

apply_filters('wpify_woo_free_shipping_render_notice', true)

Filtr očekává true nebo false

Hodnota pro dopravu zdarma

apply_filters( 'wpify_woo_free_shipping_amount', $amount, $this )

Filtr očekává číselnou hodnotu float

Změna hodnoty získání dopravy zdarma dle doručovací adresy.

add_filter( 'wpify_woo_free_shipping_amount', function ( $amount, $module ) {
    $country = WC()->customer->get_shipping_country() ?? WC()->customer->get_billing_country(); //Neníli zvolena doručovací země použije fakturační
    if ( $country == 'CZ') { //Doručovací země je "CZ"
        $amount = 80; //Nová hodnota pro CZ
    }
    return $amount; //Je-li CZ vrátí se nová hodnota jinak původní hodnota z nastavení
}, 10, 2 );

Hodnota zbývající k získání dopravy zdarma

apply_filters( 'wpify_woo_free_shipping_amount_for_free_shipping', $this->get_free_shipping_amount() - ( $this->get_cart_amount() ) )

Filtr očekává číselnou hodnotu float

Doprava je zdarma

apply_filters( 'wpify_woo_free_shipping_is_free', $amount <= 0 )

Filtr očekává true nebo false