0

I try to translate missing strings in WooCommerce. I use Loco translate but these strings are not there. I could add one filter, but I don't know which hooks I have to use

"Coupon Code" "Code here" "Apply coupon" "Update cart" "Back to cart" "Your order" "Related"

I could successfully translate "Related Products" with this filter

add_filter('woocommerce_product_related_products_heading',function(){

   return 'Services connexes';

});

Which filter can I use for the other strings or where can I find these?

1

1 Answer 1

0

The best filter to fit here is gettext_{$domain} for translating specific domain/plugin-related texts.

add_filter('gettext_woocommerce', 'translate_woocommerce_strings');

function translate_woocommerce_strings($string) {

    switch ($string) {
        case 'Apply coupon':
            $string = 'Apply koupon';
            break;
        case 'Update cart':
            $string = 'Update kart';
            break;
    }
    return $string;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.