Get a quick single-click solution to share your products on various social media platforms. Only at $29 $19Buy Now!
Public Ticket #2631

Cart Button Text translation

Christian Samuelsson

Hello,

How can I add translations to value at Cart Button Text?

I look up at product-variant-table-for-woocommerce.pot

with Loco Translate, but I cannot find the custom value at pvtfw_variant_table_cart_btn_text

Regards.

Christian Samuelsson

Christian Samuelsson

Hello, thanks for reply.

Yes, I can change the text. But how can I make translations for multi language sites?

Can you foward to developers a suggestion?

Please confirm if they are going to commit, so I do not need to worry about losing the patch in future releases. This code check translations from theme. If a user does not have a translation set, it return your default value: So it is a secure update.

file: content-tbody.php

function: pvtfw_process_table_data

$theme_data = wp_get_theme();
$text = __($btn_text, $theme_data->get( 'TextDomain' ));
//$text = $btn_text;

 

 

Christian Samuelsson

Christian Samuelsson

I just saw there is a filter. Ok, i can add the tranlations just for me. No need to foward to developers. But perhaps you want to add this snippet to your knowledge tutorials:

add_filter('pvtfw_cart_btn_text', function ( $btn_text ) {
$theme_data = wp_get_theme();
return __($btn_text, $theme_data->get( 'TextDomain' ));
});
wpxteam

wpxteam

Hi Christian,

I have already discussed the issue with our team.

We will take a look into this so that it works with Loco.

We appreciate your suggestion and patience.

Our team also have a plan to put together a developer documentation.

Is there anything else we can do for you now?

Thanks a lot & have a great day