Display variable name woocommerce in product pre-visualization

1

happy day. It happens that I would like to show the name of the variations in the product range imposed by woo comerce:

Then in the image above I have two variations, the one on the left called x and right and .

Searching for the plugin file found the function that brings these values with its class called "amount".

$formatted_price = ( $negative ? '-' : '' ) . sprintf( $price_format, get_woocommerce_currency_symbol( $currency ), $price );
$return          = '<span class="amount">' . $formatted_price . '</span>';

Then, when adding the desired text that I want to show in the variations, the result is that it will be repeated in both variations.

$formatted_price = ( $negative ? '-' : '' ) . sprintf( $price_format, get_woocommerce_currency_symbol( $currency ), $price );
$return          = '<span class="amount"> X y Y' . $formatted_price . '</span>';

Of course, with this I realized that I'm looking for the wrong side. Since this change would be something more generic and does not go directly to the problem that is to show the name of the variations.

That is why I come to you community, if you suddenly knew in what file you can find the function of the variations or if you know another method to generate this, obviously it is worth highlighting and you will tell me if what I want to do is possible.

Thank you very much.

    
asked by Juan C 08.03.2017 в 19:06
source

0 answers