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 11 replies, has 2 voices.

Last updated by Oscar Miras 6 months, 2 weeks ago.

Assigned support staff: Oscar Miras.

Author Posts
March 23, 2019 at 6:00 am #3445621

ali-hA

I am trying to: order a product in German language, current the stock of product is 1, and After checkout, I see 2-1 added in order note at woocommerce order details page, instead 1-0, But it is not happening when order from other languages, please see attached screenshot.

Link to a page where the issue can be seen:
hidden link

I expected to see: 1-0 in order note, because the current stock of the product is 1

Instead, I got: 2-1 in order note, this happens only when order from German language

The stock of the product is not changing to 0, it allows customers to purchase the same product many times.

Product setting in woocommerce: Manage stock? Enabled stock management at product level

Thanks

March 23, 2019 at 2:57 pm #3446677

Oscar Miras

Hi,

Welcome to the WPML support team.

This is a known issue and our developers are working on it. A fix for this issue is currently under review. I will update this ticket as soon as I have any news.

In the meantime, there is a temporary workaround that you may try in order to solve this issue. Please, perform a full backup of your site before applying this configuration.

  • Go to WPML > Settings.
  • Open the Custom XML Configuration tab.
  • Add next code to your Custom XML configuration and save changes.
<wpml-config>
    <custom-fields>
        <custom-field action="copy">_stock</custom-field>
    </custom-fields>
</wpml-config> 

In case you try the workaround, let me know if that fixes your problem.

Thank you for your patience.

Best wishes,
Óscar.

March 27, 2019 at 4:32 am #3467537

ali-hA

My issue is resolved now. Thank you!

March 29, 2019 at 5:44 pm #3493551

ali-hA

Hi, did you fix it in the update?

April 1, 2019 at 7:54 am #3505115

Oscar Miras

Welcome again,

The problem has been identified by our developers and they are working on it.

I'm afraid we are not able to tell if in the next update it is going to be fixed.
I'll let you know as soon as we have new information.

Thank you for your patience,
Oscar.

April 2, 2019 at 9:59 am #3515691

ali-hA

Hello there,

We have found some solution to fix the 2->1 bug, but not sure if it is right solution

File: /wp-content/plugins/woocommerce-multilingual/inc/translation-editor/class-wcml-synchronize-product-data.php

Line: 324

Modified: wc_update_product_stock( $_product, $stock ); to wc_update_product_stock( $_product, $stock, 'decrease' );

We added 'decrease' as third parameter, now it is working.

Please see the attached image for more details

Please confirm us, if the above is correct way of fixing bug.

Thanks

April 2, 2019 at 12:03 pm #3516831

Oscar Miras

Welcome back,

I'm afraid that we can't confirm that your fix is going to work in all the scenarios. It might work for some cases, but without applying all the tests that are needed to validate a change in the code, there is no guarantee that it will work in any case. Moreover, when the new version of WCML which fixes the problem is released, your changes will be overwritten.

I would recommend you to wait for the updated version of WCML which fixes this problem.

The bug is already solved in our development version of Woocommerce Multilingual.

Sorry for the inconvenience,
Oscar.

April 3, 2019 at 2:27 pm #3527205

Oscar Miras

Hi,

There is a new version of Woocommerce Multilingual and WPML core plugins.
Please, update these two plugins. The stock synchronization bug should be resolved.

After updating the plugins, please remember to remove the custom XML configuration in case your set it up.

1. Go to WPML > Settings.
2. Open the Custom XML Configuration tab.
3. Remove the XML configuration:

<wpml-config>
    <custom-fields>
        <custom-field action="copy">_stock</custom-field>
    </custom-fields>
</wpml-config> 

Thank you for your patience.

Best wishes,
Oscar.

April 5, 2019 at 6:02 am #3540739

ali-hA

Hi,

We updated the two plugins and removed the XML configuration, but still the issue exists.

Thanks

April 5, 2019 at 7:48 am #3541819

Oscar Miras

Hi,

I am requesting temporary access to your WordPress installation so I can investigate the issue properly. Please, confirm that you have a full backup of your site before proving me with working credentials.

Could you also tell me a single product you are still facing this issue?

Thank you,
Oscar.

April 8, 2019 at 9:23 am #3555945

Oscar Miras

Hi,

Thank you for your info. The development team is working on it. I will inform you whenever I have an update.

In the meantime, can you restore the XML Configuration? It should fix the problem by now.

Thank you for your patience,
Oscar.

April 8, 2019 at 2:04 pm #3558577

Oscar Miras

Hi,

I have some new information. It seems that one of the custom field translation modes is wrong. Developers have managed to make it work in the test site, so I'm asking you to copy the changes for the live site.

First of all, in WPML > Settings, open the Custom XML Configuration tab and remove again the XML configuration. Save the changes.

Afterwards, follow these steps:

  • Go to WPML > Settings. Reach the Custom Fields Translation.
  • Click in "Show system fields", below the section's title
  • In the free search input box, on the top-right corner, write "_stock" and press enter.
  • Change the value of the setting to "Don't translate". Click Save button

Please, perform now some test to find out if the issue is solved, and let me know about it.

Thank you a lot for your collaboration,
Óscar.

The topic ‘[Closed] Adds 2->1 in order note’ is closed to new replies.