Text update cart botton

hello,

my homepage www.mietzekatz-design.de

in the shopping cart the button “apply coupon” can not be translated with a plugin. I have inserted the following code from your support i have found.

       jQuery("input[name='apply_coupon']").attr("value","Gutschein anwenden");

it works .:grinning:

but there is another problem. when the cart is updated, the button “apply coupon” reappears and the translation does not appear.:weary:

can you help me.

thanks

Hi There,

Thanks for writing in! Could you please try updating your code as follows and see if that helps.

jQuery(function() {
    jQuery("input[name='apply_coupon']").attr("value","Gutschein anwenden");
});

Hope that helps.

Thank you for your prompt reply.

I copied your code and inserted it instead of the other one. But there is the same situation, i had before.

What can i do now.

Hi There,

In that case, can you try adding the following code into your child theme’s functions.php file and see if that resolves your issue.

add_filter('gettext', 'x_translate_text' , 20, 3);
function x_translate_text ( $translated_text, $text, $domain ) {

$translation = array (
'Apply Coupon' => 'Gutschein anwenden'
);

if( isset( $translation[$text] ) ) {
return $translation[$text];
}

return $translated_text;

}

Hope that helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.