1. Accueil
  2. Base de connaissances
  3. WooCommerce Wholesale Prices Premium
  4. Produits manquants lors du passage à une langue différente à l'aide de WPML
  1. Accueil
  2. Base de connaissances
  3. Problèmes de compatibilité connus
  4. Produits manquants lors du passage à une langue différente à l'aide de WPML

Produits manquants lors du passage à une langue différente à l'aide de WPML

If you’re using WPML to translate your store into multiple languages, you may find that some products don’t appear for your wholesale customers once they switch to a translated version of your site, even though the same products show up fine in the default language.

This happens because WooCommerce Wholesale Prices and WooCommerce Wholesale Prices Premium store wholesale pricing and product visibility rules as custom fields on each product, and WPML does not automatically copy those custom field values to translated products unless it is configured to do so.

This applies whether you’re using the free WooCommerce Wholesale Prices plugin or WooCommerce Wholesale Prices Premium. Some of the fields and the repair tool are only available in the Premium plugin.

Prérequis

  • WooCommerce
  • WPML, with translated versions of your products already created.
  • WooCommerce Wholesale Prices installed and activated, with at least one wholesale role set up.
  • WooCommerce Wholesale Prices Premium installed and activated, if you use the Restrict To Wholesale Roles field or the Re-Initialize Product Visibility Meta repair tool covered in this article.

Why products go missing after switching languages

WooCommerce Wholesale Prices and WooCommerce Wholesale Prices Premium store each wholesale role’s price for a product, and whether a product is restricted to wholesale roles, as WordPress custom fields attached to that product. When WPML creates a translated version of a product, it does not copy these custom field values across by default. A translated product can end up with no wholesale price, or a missing visibility setting, which is why it may appear to be missing for wholesale customers even though the original product is untouched.

Set the wholesale custom fields to copy in WPML

WPML lets you control how each custom field behaves during translation. Setting the wholesale-related fields to Copy ensures the values from the original product carry over to every translation.

  1. Go to WPML → Settings.
  2. Click the Multilingual Content Setup tab.
  3. Scroll to the Custom Field Translation section.
  4. Set wholesale-related fields to Copy.
WPML Multilingual Content Setup page showing the Custom Field Translation section with wholesale custom fields listed
WPML → Settings → Multilingual Content Setup: Custom Field Translation section

For more on how WPML handles this setting, see WPML’s documentation on translating custom fields. You can also use the Search for input field to locate any Wholesale Prices related field.

Repair a product’s visibility setting

If a product is still missing for wholesale customers after setting the custom fields to Copy, its visibility setting may be missing entirely rather than just out of sync. WooCommerce Wholesale Prices Premium includes a tool that repairs this.

  1. Go to WooCommerce → Settings → Wholesale Prices tab.
  2. Click Help in the sub-menu under the tabs.
  3. Click the Re-Initialize Product Visibility Meta button.
Re-Initialize Product Visibility Meta button on the Wholesale Prices settings Help tab
WooCommerce → Settings → Wholesale Prices → Help: Re-Initialize Product Visibility Meta button

This scans every product for a missing visibility setting and sets it to visible to everyone by default. If a product was meant to be restricted to a specific wholesale role, open that product afterward and reselect the role in the Restrict To Wholesale Roles field.

Dépannage

I set the wholesale custom fields to Copy, but a product I translated earlier still doesn’t show the wholesale price.

The Copy setting only applies going forward. A translation created before you changed the setting may need to be resynced. Open the translation in WPML’s translation editor and re-save it, or re-translate the product, so the wholesale price field is copied across.

I ran Re-Initialize Product Visibility Meta and now a product is visible to customers it shouldn’t be.

This is expected. The tool sets any missing visibility value to visible to everyone as a safe default, it does not know which role the product was originally restricted to. Open the affected product and reselect the correct role in the Restrict To Wholesale Roles field.

Do administrator or shop manager accounts see the same missing-product issue?

No. Administrator and shop manager accounts always see every product, regardless of a product’s wholesale price or visibility setting. Test with a customer account that has the wholesale role assigned to it if you want to confirm what a translated product looks like for that role.

Questions fréquemment posées

Which custom fields do I need to set to Copy in WPML?

Each wholesale role’s price field, and the Restrict To Wholesale Roles visibility field if you’re using WooCommerce Wholesale Prices Premium. Typing wholesale into the Search For box in WPML’s Custom Field Translation section surfaces all of them at once.

Do I need WooCommerce Wholesale Prices Premium to fix this?

Only if you use the Restrict To Wholesale Roles field or need the Re-Initialize Product Visibility Meta repair tool. If you’re using the free WooCommerce Wholesale Prices plugin without any visibility restrictions, setting the wholesale price fields to Copy in WPML is enough.

Will setting the custom fields to Copy fix products I’ve already translated?

Not automatically. The setting controls what happens going forward. Existing translations usually need to be resynced, either by re-saving them in WPML’s translation editor or by re-translating the product, before the wholesale fields catch up.

Does this affect the price shown to retail customers?

No. The wholesale price fields and the visibility filter only affect wholesale roles. Retail customers continue to see the regular WooCommerce price on every translation, unaffected by this setting.

Can a translated product be restricted to a different wholesale role than the original?

Yes. Once the custom fields are copying correctly, you can still open a specific translation and change its Restrict To Wholesale Roles field independently of the original product.

Does this work with WooCommerce Multilingual & Multicurrency (WCML)?

Yes. WooCommerce Wholesale Prices Premium keeps the Restrict To Wholesale Roles field in sync automatically during WCML’s product syncing process, as long as that field is set to Copy in WPML’s Custom Field Translation settings.

I don’t see a wholesale custom field in WPML’s list at all. What’s wrong?

WPML only lists custom fields that already have a saved value. Make sure the product has a wholesale price entered and saved, or a Restrict To Wholesale Roles role selected, before you look for it in the Custom Field Translation list.

Aide et support

Nous avons une équipe de support dédiée pour Wholesale Suite qui connaît très bien nos produits, WooCommerce et le secteur. Vous êtes invité à utiliser leur expertise à tout moment, partout dans le monde.

Si vous êtes un client existant, veuillez vous rendre sur le formulaire de demande de ticket de support et envoyez-nous un message.

Si vous êtes un utilisateur de plugin gratuit, veuillez nous envoyer une demande de support sur le forum. Nous surveillons activement les forums de support de WordPress.org pour le plugin gratuit et aidons nos utilisateurs du mieux que nous pouvons.

Cet article vous a-t-il été utile ?

Articles liés

Finalisez votre achat