- Status
- Aberto
- Relatado para
- WPML Multilingual & Multicurrency for WooCommerce 5.4.5
- Plugin/tema relacionado
- Product Filters for WooCommerce
- Tags de tópico
- Compatibility, WCML
Visão geral do problema
Ao usar o widget “Filtrar produtos por atributo” do Product Filters for WooCommerce e definir a opção de exibição como “Lista suspensa”, o rótulo do atributo não é traduzido no frontend (por exemplo, “Select Color”).
Solução alternativa
Certifique-se de fazer um backup completo do site antes de prosseguir.
- Adicione o seguinte código ao arquivo functions.php do seu tema.
/** * Force the translation of product attribute labels on the frontend. */ add_action( 'after_setup_theme', function() { if ( ! is_admin() && ! wpml_is_ajax() && function_exists( 'WPMLContainermake' ) ) { $wcStrings = WPMLContainermake( WCML_WC_Strings::class ); if ( $wcStrings ) { add_filter( 'woocommerce_attribute_taxonomies', [ $wcStrings, 'translate_attribute_taxonomies_labels' ] ); } } } );