I have B2b King installed and separate stock for b2b clients and b2c.
When translating products clicking on the "Translate woocommerce products", the b2b stock is not copied and is set to 0. Besides that, when a b2b customer purchases a product the stock is removed from the second language and not from the default. The b2c purchases are working fine.
Solution: By duplicating the product and then translate it, it seems to be working.
My question:
We already translated around 350 products manually before we notice this behavior. Is there any solution to duplicate those products (so the b2b stock will be the same on both languages) or we have to delete them and start over?
Thank you for contacting us and I'd be happy to assist.
I'll recommend the following steps:
1. Please go to WP Admin -> WPML -> Settings and scroll down to the 'Custom Fields Translation' section.
2. In the 'Search for' field, type 'b2bking_' and it will show the custom fields added by the B2b King.
3. Look for the custom field that is used for the stock value and change it to 'Copy' option, so that the value remains in sync between the original and the translated posts.
Hi,
Thank you for your reply.
I'm afraid this is not an option. B2b king saves the stock value in variables, so i have the same amount of variables as my products (sreenshot).
Hi,
Sorry for the delayed reply.
I can confirm that i found the custom field that i needed to, and after copying it, the new translated products are copying the stock. But this is true only for the new added products.
So the question still remains. Is any way to apply this setting to the old translated products?
Thanks for the update and glad that it is working for the new products.
I've performed some further testing and research, but couldn't find any built-in function or hook to trigger the update of those custom fields for the already added products.
You can open the edit screen of any one of the existing products and then click the 'update' button.
( you don't have to make any change to the product )
If the stock option is successfully synced with the translated product, you can repeat that for all of the existing products too.