We are having an really urgent issue with the b2b king pro plugin with wpml.
We have 3 language in our site, Main is DE, other is EN and FR. When b2b king pro plugin is active , we don't see any product in front end of EN and FR. But we can see them in backend. If we want to visit the product (EN,Fr) from backend it redirects to my account page of that language.
During debugging we found that B2BKing modifies WooCommerce product queries through:
The issue appears to come from B2BKing Pro’s product visibility filtering in public/class-b2bking-public.php.
The functions b2bking_product_categories_visibility_rules() and b2bking_visibility_wordpress_posts() generate allowed product ID lists and apply them to WooCommerce queries through post__in / post__not_in.
On our WPML multilingual WooCommerce site, the generated post__in list contains mixed-language product IDs. As a result, EN/FR shop pages stop showing products, and translated product URLs redirect to My Account with redirect_to.
Disabling B2BKing immediately fixes all translated shop pages and product URLs.
2. WPML considerations
With WPML, each translation is technically a separate product. That means one language can end up with different visibility settings than another for the same product. To avoid this, you can go into WPML settings and set the following B2BKing visibility keys to "Copy":
- b2bking_group_0
- b2bking_group_b2c
- b2bking_product_visibility_override
- b2bking_group_GROUPID (e.g. b2bking_group_73, for each of your B2B groups)
We are having an really urgent issue with the b2b king pro plugin with wpml.
We have 3 language in our site, Main is DE, other is EN and FR. When b2b king pro plugin is active , we don't see any product in front end of EN and FR. But we can see them in backend. If we want to visit the product (EN,Fr) from backend it redirects to my account page of that language.
During debugging we found that B2BKing modifies WooCommerce product queries through:
B2bking_Public::b2bking_visibility_wordpress_posts
(priority 9999 on pre_get_posts)
The affected WooCommerce shop query contained a large post__in array with mixed-language product IDs (DE/EN/FR together), which caused:
translated products not showingtranslated product URLs redirecting to My Accountmultilingual shop queries breakingCan you please help us with this ? we have to go live today.
The issue appears to come from B2BKing Pro’s product visibility filtering in public/class-b2bking-public.php.
The functions b2bking_product_categories_visibility_rules() and b2bking_visibility_wordpress_posts() generate allowed product ID lists and apply them to WooCommerce queries through post__in / post__not_in.
On our WPML multilingual WooCommerce site, the generated post__in list contains mixed-language product IDs. As a result, EN/FR shop pages stop showing products, and translated product URLs redirect to My Account with redirect_to.
Disabling B2BKing immediately fixes all translated shop pages and product URLs.
Please check B2BKing’s WPML visibility cache/transient handling, especially:
b2bking_user_{USER_ID}_ajax_visibility
b2bking_user_{USER_ID}_ajax_visibility{ICL_LANGUAGE_NAME_EN}
It seems the visibility whitelist is not being generated or cached separately/correctly per WPML language.
We just found that issue was product visibility control settings.
It's not any bug i guess. it's just that settings was not setup properly.
Hi there,
Glad to hear you found the issue,
A few things to keep in mind going forward:
1. Product visibility setup
By default, visibility is based on category settings, which can get complex when a product belongs to multiple categories. The easiest setup is to edit each product individually and configure Manual Visibility for it. More info here: https://woocommerce-b2b-plugin.com/docs/faq-product-visibility-is-not-working-how-to-set-up-product-visibility/
2. WPML considerations
With WPML, each translation is technically a separate product. That means one language can end up with different visibility settings than another for the same product. To avoid this, you can go into WPML settings and set the following B2BKing visibility keys to "Copy":
- b2bking_group_0
- b2bking_group_b2c
- b2bking_product_visibility_override
- b2bking_group_GROUPID (e.g. b2bking_group_73, for each of your B2B groups)
That way, when you save visibility on one language, it auto-copies to the other languages. The principle is similar to what's described here (the doc is about prices, but the same logic applies): https://woocommerce-b2b-plugin.com/docs/translate-b2bking-with-wpml/#3-toc-title
Let me know if anything is unclear or if you run into other issues.
Kind regards,
Stefan