• Cata91ff

    (@lancespumarero)


    Hi WooCommerce Support Team,

    After updating WooCommerce to Version 10.5.1, i noticed a change in the cart and checkout page display on my website: https://lance-spumare.ro

    On the cart page and also on the checkout page there are not show “Livrare” as before update (Livrare means Shipping/Shipping), and there is now show “Livrare 1” (Shipment 1).

    I’m experiencing an inconsistency between Cart and Checkout regarding the shipping package title. After updating WooCommerce, “Shipment 1” started appearing instead of just “Shipment”. As suggested in other thread opened for similar problem, I implemented the provided woocommerce_shipping_package_name snippet to remove the numbering when there is only one package.The snippet works correctly on the Checkout page, where only “Shipment” is displayed.However, on the Cart page, it still shows “Shipment 1”, even though there is only one shipping package (count($packages) === 1).I have confirmed via debugging that:There is only one shipping package in Cart. The filter woocommerce_shipping_package_name is running.The issue appears to affect only the Cart page.

    Could you please clarify:

    1. Is the Cart page using a different rendering logic for shipping package titles?
    2. Is there another filter or template override specifically affecting the Cart totals output?
    3. Has anything changed recently in how data-title attributes for shipping rows are generated in Cart?

    How can we change it back to display simply as “Shipping” instead of “Shipment 1”?

    I want to keep logical functionality of woocommerce, in according with the factura that maybe over some years i will have more delivery packages, and to keep number of packeges display.

    Below you can see the code I used to solve the problem, but as I already told you above, it solved the problem only on Checkout page, wihout solved the problem on the Cart page too.

    add_filter(‘woocommerce_shipping_package_name’, function ($name, $package_id, $package) {

    // Safety fallback in case, for a rare reason, shipping is not yet available.

    if ( ! function_exists(‘WC’) || ! WC() || ! WC()->shipping() ) {

    return $name;

    }

    $packages = WC()->shipping()->get_packages();

    // If there is only one package, we no longer display the number.

    if (is_array($packages) && count($packages) === 1) {

    return __(‘Livrare’, ‘woocommerce’);

    }

    // If there are multiple packages, we keep the numbering.

    return sprintf(__(‘Livrare %d’, ‘woocommerce’),

    (int) $package_id + 1);

    }, 20, 3);

    I would appreciate clarification on whether this is expected behavior and the recommended way to handle it.

    Thank you in advance for your support.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The same thing is happening to my site as well.

    Thread Starter Cata91ff

    (@lancespumarero)

    Did you tried the above snippet php code?

    Plugin Support Sai (woo-hc)

    (@saivutukuru)

    Hi @lancespumarero,

    This behavior is expected after changes introduced in WooCommerce 10.5.1.

    The reason your snippet works on Checkout but not on Cart is that the Cart page is likely using the new WooCommerce Cart Block (Blocks-based rendering), while the Checkout page is still using the classic PHP template.

    The filter woocommerce_shipping_package_name only works with the classic template system. The Cart Block does not use that PHP filter, which is why “Shipment 1” still appears there even though your code is running.

    So yes:

    • The Cart page uses different rendering logic.
    • There is no additional PHP filter affecting it.
    • The change is related to how WooCommerce Blocks now handle shipping package labels.

    If you want the numbering removed everywhere and keep your existing snippet, the simplest solution is to switch the Cart page back to the classic shortcode:

    1. Go to Pages → Cart
    2. Edit the page
    3. Replace the Cart block with this shortcode: [woocommerce_cart]
    4. Save the page

    That will make your existing filter work consistently.

    Alternatively, you can override the string via translation, but that approach will remove numbering globally and won’t dynamically support multiple packages in the future.

    If you plan to support multiple shipping packages later, keeping the numbering is aligned with WooCommerce’s current direction.

    Let us know which approach you prefer and we’ll guide you further.

    Hi again,

    No, I haven’t tried the code but I tried translating the string with WPML but it didn’t help at all – the text is still displayed as Shipment 1. Any advice for the translation or should I just use the code?

    tendenzechic

    (@tendenzeshabbychic)

    follow

    Plugin Support Sai (woo-hc)

    (@saivutukuru)

    Hi there,

    Thanks for following up. If your Cart page is using the Cart Block, then translating the string via WPML will not affect the shipping package label because that label is generated by WooCommerce Blocks (React-based rendering), not the classic PHP template system. That’s why neither the PHP snippet nor string translation is having any effect there.

    So you currently have two options:

    Option 1: Switch back to the Classic Cart (recommended if you want dynamic control)

    If you want your existing PHP filter to work consistently (including dynamic numbering when multiple packages exist), the cleanest solution is:

    1. Go to Pages → Cart
    2. Remove the Cart Block
    3. Add the shortcode: [woocommerce_cart]
    4. Save

    This will restore classic template rendering, and your woocommerce_shipping_package_name filter will work on both Cart and Checkout.

    Option 2: Keep the Cart Block

    If you want to continue using the Cart Block, customization becomes more limited because Blocks do not use the classic PHP filters. In that case:

    • Numbering is expected behavior in 10.5.1
    • Translation tools may not override it dynamically
    • Customization would require a JavaScript-based modification

    If you’re planning to support multiple shipping packages in the future, keeping the numbering is aligned with WooCommerce’s current structure.

    @anahow @tendenzeshabbychic To keep things organized, since your setup may differ from the original poster’s (theme, block/classic mix, etc.), please open a new thread and include:

    • Whether your Cart page uses the Cart Block or shortcode
    • Your WooCommerce version
    • Whether Checkout is block-based or classic

    That way we can guide you accurately without mixing configurations in this thread.

    Let us know how you’d like to proceed.

    Da

    (@0108daniel)

    Same problem here.
    The code works only on the checkout field but not on the cart page.
    Also, when you go to the checkout field you see that -after you use de code- the ‘1’ dissapears.
    So it is still visable for customers for a second or so.
    Is there a fix already because more people have this bug.

    Plugin Support LovingBro (woo-hc)

    (@lovingbro)

    Hi @0108daniel,

    Posting “me too” across multiple related threads is considered forum spam. As outlined in the forum guidelines, if you are experiencing the same issue, you should open your own topic so your specific setup and environment can be reviewed properly:
    https://wordpress.org/support/forum-user-guide/faq/#i-have-the-same-problem-can-i-just-reply-to-someone-elses-post-with-me-too

    Please refrain from continuing to post the same comment across different threads.

    To every other user who may come across this thread, kindly desist from posting “me too” replies. If you are affected, open a new topic and include your System Status Report and relevant details so we can properly review your case.

    We have already responded to you directly in this thread here:
    https://wordpress.org/support/topic/error-in-version-10-5-0-and-10-5-1/#post-18826695
    Please continue the discussion there.

    For reference, a GitHub issue has been created and the development team is currently looking into this matter: https://github.com/woocommerce/woocommerce/issues/63336

    Thank you.

Viewing 8 replies - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.