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.

Tagged: 

This topic contains 8 replies, has 2 voices.

Last updated by frederikK-4 2 years, 6 months ago.

Assisted by: Long Nguyen.

Author Posts
November 28, 2022 at 1:46 pm #12547457

frederikK-4

Barn2 Woocommerce Sample Product and Overnight's WooCommerce PDF Invoices & Packing Slips issue

November 28, 2022 at 2:25 pm #12547777

frederikK-4

So I've installed everything and this is how to replicate the issue:

1) Go to this product: hidden link
2) Click 'Order Sample'
3) Go to cart, notice how the product title has changed to: "Sample: Beanie with logo". This is correct. Barn2's plugin adds the "Sample" bit to the productname.
4) Proceed to checkout. Notice that still the word "sample" is appended to the product name. Price also is adjusted to USD 0. So far everything works fine.
5) Place order. Now notice that the product name was stored without the "Sample bit"
6) In the wp-admin part of the site, go to orders and see that in the order the word "sample" is missing too.

Now to see the correct behaviour, disable the "WooCommerce Multilingual & Multicurrency" plugin and repeat above steps. Note that in step 5 and 6 the word "Sample" still shows. This is how the plugin should behave. So somehow the "WooCommerce Multilingual & Multicurrency" plugin interferes with the behaviour of Barn2's plugin.

Kindly have a look at what is causing this.
Kind regards,
Frederik

November 29, 2022 at 4:10 pm #12556557

frederikK-4

Issue still not resolved. WPML please have a look at this issue.

November 30, 2022 at 7:36 am #12560041

Long Nguyen
WPML Supporter since 02/2022

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi there,

Thank you for contacting WPML support, I'd be happy to help you on this issue.

I see that happens on the Order Received page in the frontend and the Orders page in the backend. It looks like a compatibility issue with WooCommerce Sample Product and I'm discussing this issue with my colleagues and get back to you if I have some information.

Thanks for your patience.

November 30, 2022 at 9:39 am #12561277

frederikK-4

Hello,
Thanks for looking into it. I'll be patient 😉

Kind regards,

Frederik

December 1, 2022 at 9:28 am #12568877

Long Nguyen
WPML Supporter since 02/2022

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

Thanks for your feedback.

I've escalated this issue to our Compatibility team. I'll update you as soon as I have something to share.

Thanks.

December 1, 2022 at 12:48 pm #12570841

frederikK-4

Thank you. Looking forward to the update.

December 7, 2022 at 2:50 am #12603383

Long Nguyen
WPML Supporter since 02/2022

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

I got some news from our 2nd tier supporter. You can try this workaround on your site to fix this issue.

❌ IMPORTANT: Please backup your database and website before proceeding ❌

Access your hosting/server and edit the file wp-content/plugins/woocommerce-multilingual/inc/class-wcml-orders.php, on line 197 with WCML version 5.1.0 or line 187 with WCML version 5.0.2

$item->set_name( get_post( $translated_product_id )->post_title );

replace it with

if ( ! class_exists('\Barn2\Plugin\WC_Product_Sample\Sample') ) {
	$item->set_name( get_post( $translated_product_id )->post_title );
}

Note: you might need to re-update the code if there is an update of the WCML plugin.

This plugin is also not in our list of compatible plugins so I'd recommend that they join our Go Global program (https://wpml.org/documentation/support/go-global-program/) or you can ask them to send a request to us where our Compatibility developers will help them make their product compatible with WPML.
Please check the list of compatible plugins here https://wpml.org/plugin/

Look forward to your reply.

Thanks