When order is placed on 2nd language and the item become out of stock, it doesn't reflect on the main language. So on the frontend is also 2nd language shows SOLD OUT but the main language not, as in the images.
I tried deactivating all plugins except Woocommerce and WPML plugins, but the issue was still there.
I understand that when a product is sold on your website in the second language, the stock is not updated for the product in the original language. Did I get that right?
If that's the case, please go to the product in the original language by navigating to your WordPress dashboard → Products → and edit the product → Check the Inventory tab. Does it say 1 or 0? This will confirm if the issue is with the stock value or if it is an issue that's only visible on the front end.
If the stock value is not 0 - please send a screenshot of the received order. Please make sure to include the Order Notes section. Similar to the attached one.
So, the stock inside the product data is showing 0, but it is showing "In Stock" on the Products List page.
I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. It would be better to have a testing site where the issue is replicated.
You will find the needed fields below the comment area when you log in to leave your next reply. The information you will enter is private, meaning only you and I can see and access it.
Maybe I'll need to replicate your site locally. For this, I’ll need to temporarily install a plugin called “Duplicator” or "All in One WP Migration" on your site. This will allow me to create a copy of your site and your content. Once the problem is resolved, I will delete the local site. Let me know if this is ok with you.
IMPORTANT
- Please backup site files and database before providing us access.
- If you do not see the wp-admin/FTP fields, your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box. The private box looks like this: hidden link
I appreciate your patience while I was looking into this.
I escalated the ticket to the 2nd tier support as I was able to reproduce the issue even after editing the stock status and placing a test order again.
I'll keep you posted whenever I have more information 🙂
In the meantime, please let us know if you have any further questions. We're always happy to help!
Thank you for being so patient while we were working on this.
The issue has been escalated to our development team for a permanent fix. In the meantime, you can use the following workaround to prevent the issue from happening again:
Go to: wp-content/plugins/woocommerce-multilingual/inc/translation-editor/class-wcml-synchronize-product-data.php:
Find the following function:
public function sync_stock_status_for_translations( $product_id, $status ) {
if ( $this->woocommerce_wpml->products->is_original_product( $product_id ) ) {
$translations = $this->post_translations->get_element_translations( $product_id, false, true );
foreach ( $translations as $translation ) {
$this->woocommerce_wpml->products->update_stock_status( $translation, $status );
$this->wc_taxonomies_recount_after_stock_change( $translation );
}
}
}
and replace it with:
public function sync_stock_status_for_translations( $product_id, $status ) {
// if ( $this->woocommerce_wpml->products->is_original_product( $product_id ) ) {
$translations = $this->post_translations->get_element_translations( $product_id, false, false );
foreach ( $translations as $translation ) {
$this->woocommerce_wpml->products->update_stock_status( $translation, $status );
$this->wc_taxonomies_recount_after_stock_change( $translation );
}
}
// }
That will prevent the issue from happening in the future. For the current product, you can go to the product edit page and just hit the update button. The stock status will be changed to out of stock.
Hope that helps, and let us know if you have any other questions. We would be happy to assist further.