For Developers
Shortcodes
Section titled “Shortcodes”Free Shipping Notice
Section titled “Free Shipping Notice”[wpify_woo_free_shipping_notice]Displays the complete notice including the progress bar and text.
Remaining Amount Only
Section titled “Remaining Amount Only”[wpify_woo_amount_for_free_shipping]Displays only the formatted remaining amount (e.g., 500 Kč).
Filters
Section titled “Filters”wpify_woo_free_shipping_render_notice
Section titled “wpify_woo_free_shipping_render_notice”Allows conditionally hiding the notice.
apply_filters( 'wpify_woo_free_shipping_render_notice', bool $render );Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
$render | bool | Display notice (default: true) |
Example: Hide for Logged-in Users
Section titled “Example: Hide for Logged-in Users”add_filter( 'wpify_woo_free_shipping_render_notice', function( $render ) { if ( is_user_logged_in() ) { return false; } return $render;} );wpify_woo_free_shipping_amount
Section titled “wpify_woo_free_shipping_amount”Modifies the free shipping limit value.
apply_filters( 'wpify_woo_free_shipping_amount', float $amount, object $module );Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
$amount | float | Free shipping amount |
$module | object | FreeShippingNoticeModule instance |
Example: Different Limits by Country
Section titled “Example: Different Limits by Country”add_filter( 'wpify_woo_free_shipping_amount', function( $amount, $module ) { $country = WC()->customer->get_shipping_country() ?? WC()->customer->get_billing_country();
if ( $country === 'SK' ) { return 50; // 50 EUR for Slovakia }
return $amount; // Default for other countries}, 10, 2 );wpify_woo_free_shipping_amount_for_free_shipping
Section titled “wpify_woo_free_shipping_amount_for_free_shipping”Modifies the remaining amount until free shipping.
apply_filters( 'wpify_woo_free_shipping_amount_for_free_shipping', float $remaining );Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
$remaining | float | Remaining amount (can be negative) |
wpify_woo_free_shipping_is_free
Section titled “wpify_woo_free_shipping_is_free”Determines whether shipping is free.
apply_filters( 'wpify_woo_free_shipping_is_free', bool $is_free );Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
$is_free | bool | Shipping is free (default: $remaining <= 0) |
Example: Free Shipping for VIP Customers
Section titled “Example: Free Shipping for VIP Customers”add_filter( 'wpify_woo_free_shipping_is_free', function( $is_free ) { $user = wp_get_current_user(); if ( in_array( 'vip_customer', $user->roles ) ) { return true; } return $is_free;} );CSS Classes
Section titled “CSS Classes”| Class | Element |
|---|---|
.wpify-woo-free-shipping-notice__wrapper | Outer wrapper (used for AJAX fragments) |
.wpify-woo-free-shipping-notice | Main notice container |
.progress | Progress bar container |
.progress-value | Filled part of the progress bar |
Custom Styling Example
Section titled “Custom Styling Example”.wpify-woo-free-shipping-notice { border-radius: 8px; margin-bottom: 20px;}
.wpify-woo-free-shipping-notice .progress { height: 15px; margin-top: 10px;}
.wpify-woo-free-shipping-notice .progress-value { background: linear-gradient(90deg, #4CAF50, #8BC34A);}AJAX Updates
Section titled “AJAX Updates”The notice automatically updates when:
- Adding a product to cart
- Changing quantity in cart
- Removing a product from cart
- Updating checkout
The module uses WooCommerce fragments (woocommerce_add_to_cart_fragments and woocommerce_update_order_review_fragments).
Compatibility
Section titled “Compatibility”Woo Currency Switcher
Section titled “Woo Currency Switcher”The module is compatible with the Woo Currency Switcher plugin. The free shipping limit is automatically recalculated using the woocs_exchange_value filter.
Where to Add Code
Section titled “Where to Add Code”You can add custom functions to:
- The
functions.phpfile in your child theme - The Code Snippets plugin