Not translating woocommerce attributes
-
Hey,
I have an issue with translations of the attributes.
They are translated in backend as seen here: https://prnt.sc/w0u8yKO3ABbdBut when I pull attributes via code, it does not pull translation, always default language:
<?php global $product; $attributes = $product->get_attributes(); if( $attributes ) : ?> <div class="fl-atts"> <h2 class="fl-eq-title"><?php echo __( 'Technical data', 'shoptimizer' ) ?></h2> <?php foreach ( $attributes as $attribute ) : // skip variations if ( $attribute->get_variation() ) { continue; } $name = $attribute->get_name(); $value_string = implode( ', ', $attribute->get_options() ); ?> <div class="fl-att"> <div class="fl-att-label"><?php _e($name, 'woocommerce') ?></div> <div class="fl-att-value"><?php _e($value_string, 'woocommerce') ?></div> </div><?php endforeach; endif; ?>
I guess this part does not pull the translations, but the question is why?
_e($name, ‘woocommerce’)
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Not translating woocommerce attributes’ is closed to new replies.