Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter harryfear

    (@harryfear)

    This looks like a case-sensitivity bug, which I am temporarily patching with a hotfix. WooCommerce’s translation targets only Sign Up Now in title case, not what was being printed in sentence case.

    function custom_subscription_button_text( $button_text, $product ) {
        if ( $product->is_type( array( 'subscription', 'variable-subscription' ) ) ) {
            $button_text = __( 'Sign up now', 'woocommerce-subscriptions' );
        }
        return $button_text;
    }
    add_filter( 'woocommerce_product_single_add_to_cart_text', 'custom_subscription_button_text', 10, 2 );
    add_filter( 'woocommerce_product_add_to_cart_text', 'custom_subscription_button_text', 10, 2 );
    
    function custom_subscription_checkout_button_text( $button_text ) {
        global $woocommerce;
    
        // check if the cart contains a subscription product
        foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $cart_item ) {
            $product = $cart_item['data'];
            if ( WC_Subscriptions_Product::is_subscription( $product ) ) {
                // change the button text for subscriptions
                $button_text = __( 'Sign up now', 'woocommerce-subscriptions' );
                break;
            }
        }
    
        return $button_text;
    }
    add_filter( 'woocommerce_order_button_text', 'custom_subscription_checkout_button_text' );

    Hey there,

    Thank you for reaching out to us and providing this hotfix!

    Have you tried translating this string through String Translation from the Translation Interface?

    If TP detects these string you should be able to translate them. I will try to replicate this behavior on my own instance.

    All the Best,

    Plugin Support Anghel Emanuel

    (@anghelemanuel99)

    Hello there,

    Since 5 days have already passed from the last reply, I will consider this issue solved and I will mark it as “Resolved”.

    If there`s anything else, please let me know!

    Kind Regards,

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘woocommerce subscriptions translations not executing’ is closed to new replies.