Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 15 replies, has 2 voices.

Last updated by Kor 11 months, 3 weeks ago.

Assisted by: Kor.

Author Posts
January 30, 2024 at 6:59 pm

manuelH-29

The shipping method labels/ titles are not being displayed like I’ve entered in the backend.

All of them are looking like this: free_Versandkosten6_Versandkosten_method_title

When I disable WPML it works normal.

I recently switched From German to German (Formal)

January 30, 2024 at 7:42 pm
January 30, 2024 at 7:53 pm #15246384

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience.

We apologize for the inconvenience, but in order to proceed with troubleshooting, we kindly request a site snapshot. Alternatively, with your permission, we can create a snapshot on our own.

For this purpose, we typically recommend using the free plugin "Duplicator." If you are already familiar with how Duplicator works ( https://wordpress.org/plugins/duplicator/), please skip the following steps and simply send me the archive file you downloaded.

To assist you further, please follow these instructions:
Watch the Duplicator instructions video: hidden link

Refer to the instructions provided by WPML on how to provide supporters a copy of your site: https://wpml.org/faq/provide-supporters-copy-site/

If the archive file exceeds 400MB in size, please utilize Duplicator's file filters to exclude the cache, wp-uploads directory, media, and archive files.

Once you have the archive file, please share the link with us. You can use services such as Google Drive, Dropbox, or similar platforms as the snapshot file will likely be large.

Please note that your next reply will be private, visible only to you and me. You can paste the link to the file there. Rest assured that once the issue is resolved, I will delete the local site.

January 30, 2024 at 8:04 pm #15246418

manuelH-29

Please go ahead and create the snapshot on your own.

January 30, 2024 at 9:25 pm #15246563

manuelH-29

Can you confirm?

January 31, 2024 at 3:32 pm #15250231

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience.

I've rechecked and it looks like the issue is related to the Elementor and Elementor pro. When I deactivated both plugins, the shipping title showed correctly. Could you check the checkout page template to see if you've misconfigured anything?

January 31, 2024 at 3:47 pm #15250257

manuelH-29

Unfortunately, there are no options in Elementor, concerning WooCommerce shipping. Is there a compatibility issue with WPML and Elementor maybe?

January 31, 2024 at 4:49 pm #15250603

manuelH-29

Any solution?

January 31, 2024 at 4:53 pm #15250630

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

Sorry, I don't have a quick solution for now. Please allow me to escalate this to our 2nd Tier Support for further investigation. I will come back to you once I've feedback.

January 31, 2024 at 4:56 pm #15250736

manuelH-29

Yes please go ahead! There's time pressure as I mentioned earlier...

February 1, 2024 at 3:23 pm #15255631

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

I appreciate your patience.

I am in the process of submitting a report, but I've observed that the shipping title is now displaying correctly even when I'm not logged in. Did you manage to resolve this issue on your own?

Screenshot_68.png
February 1, 2024 at 3:26 pm #15255713

manuelH-29

Unfortunately, I had to do some PHP Coding on my own to resolve it temporarily... it still would be nice from you if there'd be another solution? You still have the duplicate you can work on, right?

February 1, 2024 at 3:27 pm #15255717

manuelH-29

That's the code:
// Change the full label of shipping methods on the cart and checkout pages
add_filter( 'woocommerce_cart_shipping_method_full_label', 'change_shipping_method_full_label', 10, 2 );
function change_shipping_method_full_label( $label, $method ) {
// Retrieve the correct title from the method settings
$shipping_method_instance = WC_Shipping_Zones::get_shipping_method( $method->instance_id );
if ( $shipping_method_instance && method_exists( $shipping_method_instance, 'get_option' ) ) {
$custom_title = $shipping_method_instance->get_option( 'title' );
if ( !empty( $custom_title ) ) {
// Decode HTML entities for plain text contexts
$price_display = html_entity_decode( wc_price( $method->cost ), ENT_QUOTES, 'UTF-8' );
$label = $custom_title . ': ' . $price_display;
if ( $method->get_shipping_tax() > 0 && WC()->cart->display_prices_including_tax() ) {
$label .= ' ' . html_entity_decode( WC()->countries->inc_tax_or_vat(), ENT_QUOTES, 'UTF-8' );
}
}
}
return $label;
}

// Global change for shipping method titles
add_filter( 'woocommerce_shipping_rate_label', 'change_shipping_method_titles_globally', 10, 2 );
function change_shipping_method_titles_globally( $label, $method ) {
// Get the instance of the shipping method
$shipping_method_instance = WC_Shipping_Zones::get_shipping_method( $method->instance_id );
if ( $shipping_method_instance && method_exists( $shipping_method_instance, 'get_option' ) ) {
$custom_title = $shipping_method_instance->get_option( 'title' );
if ( ! empty( $custom_title ) ) {
// Replace the label with the custom title from the shipping method settings
// Decode HTML entities for plain text contexts
$label = html_entity_decode( $custom_title, ENT_QUOTES, 'UTF-8' );
}
}

return $label;
}

But it still doesn't work in the backend...

February 1, 2024 at 3:33 pm #15255766

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thank you for your response.

It would be beneficial if there were a staging site available that I could present live to our 2nd Tier Support. However, if that's not possible, I will proceed with uploading it to our Cloudways server and include it in the report. I will make sure to keep you informed of any updates.

February 1, 2024 at 3:37 pm #15255795

manuelH-29

No, unfortunately, there's no staging site available.
Thank you very much!