Browser: Chrome 152
OS: macOS
Hi guys! Another small one from the native checkout. The price shown next to each shipping method in the woocommerce-shipping-options element doesn’t match what WooCommerce shows (or charges) on stores that display prices including tax.
Environment: Bricks 2.4.3, WooCommerce 11.1.1, WordPress 7.1.3. The store shows prices including tax (27% VAT).
What the customer sees
- A method that costs 2,990 (incl. tax) is listed as 2,354 — the net amount.
- A method whose price is added by a shipping plugin is listed as “Free”.
- The order summary and the total are correct (they include 2,990), so the list and the total disagree.
Cause
includes/woocommerce/elements/woocommerce-shipping-options.php, unchanged in 2.4.3:
private function get_rate_secondary_label( $method ) {
$cost = method_exists( $method, 'get_cost' ) ? (float) $method->get_cost() : 0;
if ( $cost <= 0 ) {
return esc_html__( 'Free', 'woocommerce' );
}
return wp_kses_post( wc_price( $cost ) );
}
Three things differ from WooCommerce’s own wc_cart_totals_shipping_method_label():
- The shipping tax isn’t added, and
woocommerce_tax_display_cart isn’t checked, so incl-tax stores always see net prices.
woocommerce_cart_shipping_method_full_label is never applied. Plugins that price or annotate a method through that filter (pickup-point plugins do this) end up as “Free” or lose their text. The filter name doesn’t appear anywhere in the theme.
- There’s no Bricks filter on this label, so the only workaround is post-processing the rendered HTML.
Suggested fix
Build the secondary label the way wc_cart_totals_shipping_method_label() does — respect the tax display setting, add get_shipping_tax() when displaying incl. tax — and run woocommerce_cart_shipping_method_full_label (or expose an equivalent Bricks filter). “Free” should only appear when the method is actually free after that.
My workaround: a bricks/frontend/render_element filter that replaces each …__secondary-label with WooCommerce’s own label. It works on the AJAX re-render too, but it’s per-store code for something the element could do natively.
Hi @roundedhexagon
Thanks for the detailed report. We reproduced the shipping tax-display mismatch. We are working on it.
For the separate “Free” label, which shipping plugin and version are you using, and what settings produce the affected shipping method?
Hi Jenn, great, thanks for reproducing the tax part!
For the “Free” label, it’s the same plugin as in the hooks topic: Hungarian Pickup Points & Shipping Labels for WooCommerce by Viszt Péter (hungarian-pickup-points-for-woocommerce), 4.2.8. The affected method is its pickup-point method (vp_pont). There’s nothing special in the setup: a pickup-point method is added to the shipping zone, and its price is set in the plugin’s own pricing table. The WooCommerce rate itself is registered with cost 0, and the plugin shows the real price through woocommerce_cart_shipping_method_full_label (VP_Woo_Pont::change_shipping_method_label).
Measured today in a fresh cart, no pickup point selected yet (Bricks 2.4.3, WooCommerce now 11.2.1, prices displayed incl. tax):
| rate |
cost / tax |
WooCommerce label |
Bricks |
vp_pont:4 |
0 / 0 |
GLS Csomagpont: 1 990 Ft |
Free |
flat_rate:2 |
2354 / 635.58 |
2 990 Ft |
2 354 Ft |
local_pickup:3 |
0 / 0 |
(no price) |
Free (fine) |
So I think one change would cover both issues: if the secondary label reused the price part of wc_cart_totals_shipping_method_label(), it would follow the tax display setting and apply the full_label filter in one go. That filter is WooCommerce core’s own extension point, so other shipping plugins that rely on it would be covered too. A small Bricks filter on the secondary label would also be welcome, as an escape hatch for edge cases.
Thanks again!
We’ve addressed this in Bricks 2.4.4, now available as a one-click update in your WordPress Dashboard.
Please read the changelog entry before updating, and let us know if you experience any issues.
Hi guys! Confirmed on 2.4.4 — thank you! Flat rate now shows 2,990 Ft (incl. VAT) instead of the net amount, and the pickup-point method shows its plugin price instead of “Free”. The radio field fix (#40620) also checks out: unique IDs, clickable labels, default pre-selected.
One small leftover, only when a plugin changes the label through woocommerce_cart_shipping_method_full_label: the method name appears twice.
Environment: Bricks 2.4.4, WooCommerce 11.2.1, Hungarian Pickup Points for WooCommerce.
What the customer sees in the woocommerce-shipping-options element:
Pickup points
Pickup points: 1,990 Ft (incl. VAT)
The primary label is $method->get_label(). When the filtered label differs from the unfiltered one, get_rate_secondary_label() returns the whole filtered string, and that string already starts with the method name (the plugin wraps it as <span class="vp-woo-pont-shipping-method-label">Pickup points: <price…></span>).
Possible fixes:
- If the filtered label differs, render it once in place of both labels. That’s how WooCommerce’s own template shows it.
- Or strip a leading
get_label() . ': ' from the filtered text before placing it in the secondary slot. That only helps when the plugin keeps the standard prefix, though.
Minor compared to the original issue, just mentioning it since the fix is fresh.
Thanks for confirming the fixes and flagging the remaining issue. We reproduced the duplicate method name when a plugin customizes the full shipping label, we will fix that.
We’ve addressed this in Bricks 2.4.5, now available as a one-click update in your WordPress Dashboard.
Shipping methods whose label is customized by a plugin, such as the pickup-point label, now show the method name only once.
Please read the changelog entry before updating, and let us know if you experience any issues.