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.

Our next available supporter will start replying to tickets in about 6.70 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

Supporter timezone: Asia/Singapore (GMT+08:00)

This topic contains 13 replies, has 2 voices.

Last updated by Kor 2 weeks, 1 day ago.

Assisted by: Kor.

Author Posts
March 21, 2024 at 9:28 am #15435242

laszloM-5

Hello Kor,

We are using 3rd party plugin for invoice generation which fits for the local law.
If you can send me direction how to get the product name regarding the order "language", I would be very happy.

I have run a round with the developers of the invoice plugin and they send me the following snippet:

foreach ( $order->get_items() as $item_id => $item ) {

if( $item['variation_id'] > 0 ){
$product_id = $item['variation_id']; // variable product
} else {
$product_id = $item['product_id']; // simple product
}

// Get the product object
$product = wc_get_product( $product_id );
$paramt[$counter]['product_name'] = "".htmlspecialchars($product->get_name())."";
$paramt[$counter]['quantity'] = $item->get_quantity();

So if you can send me a direction how to get the language (en, de, ro, hu) for the order and get the product name regarding it, I would be very happy because they will implement it.

Best regards,
Laszlo

March 22, 2024 at 7:14 pm #15442364

Kor
Supporter

Languages: English (English )

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

Thank you for getting back to me.

I require further clarification on the functionality of the custom plugin regarding invoice generation. Could you provide a detailed scenario illustrating how it operates? This information is necessary for me to compose a report for our 2nd Tier Support team, who will then be able to offer additional guidance and assistance.

Furthermore, please be aware that custom programming falls outside the realm of our standard support services. Nevertheless, we remain committed to doing everything within our capacity to aid you in this matter.

March 25, 2024 at 4:08 pm #15447826

laszloM-5

Hi Kor,

Sorry to say that in the past it worked as I mentioned. I can provide you evidence regarding this, but not in public.
Colud you please open me a private chanel where I can upload the evidence?

Best regards,
Laszlo

March 26, 2024 at 1:22 pm #15451558

Kor
Supporter

Languages: English (English )

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

Thanks for your reply.

Ok sure. I've enabled private reply option for you.

April 2, 2024 at 5:23 pm #15474633

laszloM-5

Hi,

Sorry for late answer.
I have attached an invoice which one is generated at 2023.04.28.
It means that at least for that day it worked.

Best regards,
Laszlo

innvoice.png
April 3, 2024 at 10:28 am #15477429

Kor
Supporter

Languages: English (English )

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

Thank you for responding.

Upon reviewing the screenshot you provided, could you please clarify how this invoice is generated? Is it custom coded somewhere on the site? I need to understand the process before I can escalate this to our 2nd Tier Support to explore the possibilities of achieving your requirements.

April 4, 2024 at 10:49 am #15482497

laszloM-5

Hi Kor,

It is a plugin called by the shop manager inside the order edit page which goes thru the order items inside the order and create an XML then send the names, prices, SKUs via an API call to the invoice system where the invoice generating from the received data. So the invoice system does not store the name of the products either the price.
It seems that after April of 2013 an update changed the way how the product name appears to the shop manager.
I have already sent the code snippet.

Best regards,
Laszlo

April 5, 2024 at 8:42 am #15486864

Kor
Supporter

Languages: English (English )

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

Thank you for responding.

Would you mind providing access to your website and guiding me through the functionality of the "Shop Manager" plugin, as well as indicating where I can find the code snippet responsible for generating the invoice? Subsequently, I'll pass this information along to our 2nd Tier Support for further insights.

Please note that it is important to have a backup for security purposes and to prevent any potential data loss. You can use the UpdraftPlus plugin (https://wordpress.org/plugins/updraftplus/) to fulfill your backup requirements.

Your upcoming reply will be treated with confidentiality and will only be visible to you and me.

✙ I may need your consent to deactivate and reactivate plugins and the theme, as well as make configuration changes on the site if necessary. This emphasizes the significance of having a backup.

April 8, 2024 at 10:57 am #15493757

Kor
Supporter

Languages: English (English )

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

Thanks for your reply.

I can see the custom PHP code in cmfx-woo-intigration/includes/cmfx.php line 376 . One more question before I can forward this report to our 2nd Tier Support. Where can I view the invoices? I don't see any buttons here hidden link to generate it.

April 8, 2024 at 11:36 am #15493886

laszloM-5

Hi Kor,

It is there, called "Számlakészítés", attached screenshot.
As your support more then slowly (like a snake), I made some search and found that it is worked fine for most of the users before 2023.04., a lot of user face with the same problem.
What I have found that the invoice team can query the language/site of the order with:
get_post_meta($order_id, 'wpml_language', true);

Now we are looking for how we can get the product name in the proper language as the table "wp_woocommerce_order_items" contains the wrong language of the items.

Best regards,
Laszlo

kép_2024-04-08_132214105.png
April 9, 2024 at 4:44 pm #15500391

Kor
Supporter

Languages: English (English )

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

Thank you for getting back to me.

I've reviewed the order you mentioned at hidden link, and when clicking on the "Számlakészítés" button, it displays the following message: "HIBA:057 Nincs ilyen cikkszám: 101593hiba:" as shown in the attached screenshot

How can I proceed to generate the invoice? Additionally, I want to inform you that this pertains to custom programming work, which falls outside the scope of our standard support. I'm in the process of escalating this to our 2nd Tier Support in hopes that they can investigate further and potentially provide assistance if the issue doesn't require extensive customization.

Screenshot_360.png
April 9, 2024 at 5:43 pm #15500787

laszloM-5

Hi Kor,

I have setup for the testing invoice system, so you can create it now.
I do not need any custom programming from your side!
I just need to fix it as it worked before.
So the order should contains the product name in the foreign language as before, see the evidences what I have sent, but I can send you a lot of more from the past years.
What I have found when looking around in the forums that the table called "wp_woocommerce_order_items" should contains the proper product name, but right now it is not true on my site.

Best regards,
Laszlo

April 10, 2024 at 5:30 pm #15505982

Kor
Supporter

Languages: English (English )

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

Thanks for your reply.

Please allow me to escalate this to our 2nd Tier Support for further investigation. I will come back to you once I've feedback.

April 12, 2024 at 5:34 pm #15513730

Kor
Supporter

Languages: English (English )

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

Thanks for your patience.

Our 2nd Tier Support shared the custom PHP code below and could you please try adding the code to your code to see if it helps? Also, try configuring the WPML > Language > Make themes work in multi-languages Option.

global $sitepress;
		remove_filter(
			'get_pages',
			[ $sitepress, 'get_pages_adjust_ids' ],
			1
		);

The topic ‘[Feature Request] get the product name of the order language for invoicing plugin’ is closed to new replies.