0

I searched the internet for a possible solution but wasnt able to find one.

The Labels of linked products in a grouped product apear like:

[:de]german value[:en]english value[:]

My goal is to get the title/label in the current languge of my site

do I need to edit the call of my label in grouped.php?

if you need any further information tell me.

1 Answers1

0

You have to edit grouped.php inside /wp-content/themes/YOUR_THEME/woocommerce/single-product/add-to-cart/grouped.php

Wrap all the instances of $grouped_product->get_name() into a __() function.

In my case I had the following code in grouped.php:

<?php echo $grouped_product->is_visible() ? '<a href="' . esc_url( apply_filters( 'woocommerce_grouped_product_list_link', get_permalink( $grouped_product->get_id() ), $grouped_product->get_id() ) ) . '">' 
. $grouped_product->get_name() . '</a>' : $grouped_product->get_name(); ?>

so I used the translation function __() to get rid of qTranslate-X language tags:

<?php echo $grouped_product->is_visible() ? '<a href="' . esc_url( apply_filters( 'woocommerce_grouped_product_list_link', get_permalink( $grouped_product->get_id() ), $grouped_product->get_id() ) ) . '">' 
. __($grouped_product->get_name()) . '</a>' : __($grouped_product->get_name()); ?>
ace
  • 1
  • 3