Skip to content

For Developers

[wpify_woo_free_shipping_notice]

Displays the complete notice including the progress bar and text.

[wpify_woo_amount_for_free_shipping]

Displays only the formatted remaining amount (e.g., 500 Kč).

Allows conditionally hiding the notice.

apply_filters( 'wpify_woo_free_shipping_render_notice', bool $render );
ParameterTypeDescription
$renderboolDisplay notice (default: true)
add_filter( 'wpify_woo_free_shipping_render_notice', function( $render ) {
if ( is_user_logged_in() ) {
return false;
}
return $render;
} );

Modifies the free shipping limit value.

apply_filters( 'wpify_woo_free_shipping_amount', float $amount, object $module );
ParameterTypeDescription
$amountfloatFree shipping amount
$moduleobjectFreeShippingNoticeModule instance
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 );
ParameterTypeDescription
$remainingfloatRemaining amount (can be negative)

Determines whether shipping is free.

apply_filters( 'wpify_woo_free_shipping_is_free', bool $is_free );
ParameterTypeDescription
$is_freeboolShipping is free (default: $remaining <= 0)
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;
} );

wpify_woo_free_shipping_notice_custom_html

Section titled “wpify_woo_free_shipping_notice_custom_html”

Replaces the default notice HTML with your own markup.

apply_filters( 'wpify_woo_free_shipping_notice_custom_html', string|null $custom_html, array $context, object $module );
ParameterTypeDescription
$custom_htmlstring|nullReturn a string to override the default template (default: null)
$contextarrayRender context — see below
$moduleobjectFreeShippingNoticeModule instance
KeyTypeDescription
cart_amountfloatCurrent cart amount
free_shipping_amountfloatFree shipping threshold
amount_for_free_shippingfloatRemaining amount until free shipping
amount_for_free_shipping_htmlstringFormatted remaining amount (via wc_price())
percentage_for_free_shippingintProgress percentage (capped at 100)
free_shipping_messagestringResolved message (regular or confirmation)
is_free_shippingboolWhether shipping is currently free

⚠️ The returned string is echoed without escaping. Escape any data coming from $context yourself (esc_html(), wp_kses_post(), …).

add_filter( 'wpify_woo_free_shipping_notice_custom_html', function( $html, $context ) {
if ( $context['is_free_shipping'] ) {
return '<div class="my-notice my-notice--success">'
. esc_html( $context['free_shipping_message'] )
. '</div>';
}
return sprintf(
'<div class="my-notice"><strong>%s</strong> %s</div>',
esc_html( $context['free_shipping_message'] ),
$context['amount_for_free_shipping_html']
);
}, 10, 2 );
ClassElement
.wpify-woo-free-shipping-notice__wrapperOuter wrapper (used for AJAX fragments)
.wpify-woo-free-shipping-noticeMain notice container
.progressProgress bar container
.progress-valueFilled part of the progress bar
.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);
}

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).

The module is compatible with the Woo Currency Switcher plugin. The free shipping limit is automatically recalculated using the woocs_exchange_value filter.

You can add custom functions to:

  • The functions.php file in your child theme
  • The Code Snippets plugin