问题概述
将 WooCommerce Wholesale Prices 与 WPML 搭配使用时,您可能会遇到以下问题:批发客户购买已翻译的产品时支付的是零售价,并且批发价格标题和“See wholesale prices”文本仍显示为英语。
临时解决方法
前往WPML设置,并将以下内容添加到自定义 XML 配置中:
XML
<wpml-config>
<custom-fields>
<custom-field action="copy">wholesale_customer_wholesale_price</custom-field>
<custom-field action="copy">wholesale_customer_have_wholesale_price</custom-field>
</custom-fields>
<admin-texts>
<key name="wwpp_settings_wholesale_price_title_text"/>
<key name="wwp_see_wholesale_prices_replacement_text"/>
</admin-texts>
</wpml-config>如果您使用其他批发角色,请为每个角色添加相同的两行custom-field(用角色名称代替wholesale_customer)。然后更新产品翻译,并在WPML字符串翻译中翻译文本。从早于 2.2.3 的版本更新后,请保存一次插件设置。