Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1222925

    I wanted to change Shipping to Delivery throughout. I’m using the code below and it seems to be working on other theme but not on Enfold. Using Enfold theme, the backend is changed but not the Cart and Checkout page.

    function fix_woocommerce_strings( $translated, $text, $domain ) {
        // STRING 1
        $translated = str_ireplace( 'Shipping', 'Delivery', $translated );
        return $translated;
        }
        add_filter( 'gettext', 'fix_woocommerce_strings', 999, 3 );
    

    Do I need to change this manually on Enfold template. If so, where can I place the page in the child theme?

    #1224443

    Hey dinmix,
    Sorry for the late reply, I have tested this function on my localhost and it worked correctly in the Cart and Checkout page. Try adding this code to the end of your functions.php file in Appearance > Editor:

    add_filter( 'woocommerce_shipping_package_name' , 'woocommerce_replace_text_shipping_to_delivery', 10, 3);
    function woocommerce_replace_text_shipping_to_delivery($package_name, $i, $package){
        return sprintf( _nx( 'Delivery', 'Delivery %d', ( $i + 1 ), 'shipping packages', 'put-here-you-domain-i18n' ), ( $i + 1 ) );
    }

    Then clear your browser cache and check.

    Best regards,
    Mike

    #1224820

    Thank you Mike! it works.

    #1225005

    Hi,

    Great, I’m glad that Mike could help you out. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.