• Resolved lewiscornwell

    (@lewiscornwell)


    Hello,

    I have exhausted Google with this question!

    Throughout the checkout process (as well as email) I need the change the word/label ‘Shipping’ to ‘Delivery’.

    I have copied Checkout > review-order.php to my theme directory and can see
    wc_cart_totals_shipping_html();

    I am unsure however how to edit this HTML. Also, if there is a better way to edit this globally?

Viewing 11 replies - 1 through 11 (of 11 total)
  • The Say What? plugin can do this. Use woocommerce for the text domain when setting up a string change. It should not be necessary to edit templates or code.

    dougaitken

    (@dougaitken)

    Automattic Happiness Engineer

    Hi @lewiscornwell

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

    @dougaitken

    Sorry to re-open someone else’s thread but I have the exact same issue.

    How do I change “shipping” to “delivery” throughout the cart & checkout and then onto the WooCommerce emails? Its just shipping is more an American expression and my British clients much prefer delivery.

    Is there a single constant or a database field that I can change once and the update will ripple through?

    This would make a great feature request.

    Thanks in advance.

    Is anyone supporting WooCommerce?

    Try this function:

    add_filter( 'woocommerce_shipping_package_name', 'custom_shipping_package_name' );
    function custom_shipping_package_name( $name ) {
      return 'Delivery';
    }

    @lorro

    Thanks for replying

    That worked for the cart and the checkout pages, but not the email.

    shipping_email

    Any ideas?

    Any word from WooCommerce?

    Thanks

    That’s translatable text so you can use the Say What? plugin.

    Note that the string to be translated is
    Shipping:
    the colon is a necessary part of the Original string.

    @lorro

    Thank you very much!

    The plugin Say What? worked perfectly.

    This is what I entered: (See Screenshot1)

    screenshot1

    This plugin changed the string “Shipping:” to “Delivery:” in the email that gets sent out by WooCommerce for a “New Order”.

    The result: (See Screenshot2)

    screenshot2

    N.B. As you said, be sure to include the colon on the end of Shipping: otherwise it doesn’t work!

    Thankfully this change also rippled through to the PDF invoice that I attached to the email using the WooCommerce PDF Invoices & Packing Slips plugin.

    So that’s two fixes in one!

    Thank you.

    @lorro

    BTW

    Your code above gave a fatal error!

    I dug around on the net and found these two snippets of code here:

    https://stackoverflow.com/questions/31017626/how-to-change-woocommerce-text-shipping-in-checkout

    Snippet #1
    To change “Shipping” to “Delivery” on the Cart and Checkout Pages:

    
    add_filter( 'woocommerce_shipping_package_name' , 'woocommerce_replace_text_shipping_to_delivery', 10, 3);
    
    /**
     * 
     * Function to replace shipping text to delivery text
     * 
     * @param $package_name
     * @param $i
     * @param $package
     *
     * @return string
     */
    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 ) );
    }
    

    Snippet #2
    To change “Shipping” to “Delivery” on the Order-Received page e.g.
    https://example.com/checkout/order-received

    
    /*
     *  Change the string "Shipping" to "Delivery" on Order Received page.
     */
    add_filter('gettext', 'translate_reply');
    add_filter('ngettext', 'translate_reply');
    
    function translate_reply($translated) {
    $translated = str_ireplace('Shipping', 'Delivery', $translated);
    return $translated;
    }
    

    I must say needing 2 pieces of code and a plugin to change Shipping to Delivery is either incompetence on my behalf or is it that WooCommerce is deliberately designed in such a way as to make life as difficult as possible for the average developer?

    Hi

    Thank you very much for this train, it helped me a lot, the function works but I have a problem with the insertion of the word – Delivery is in my language Po?tovné.

    When I add this does not work with diacritics. put in page this Po?tovn?

    I send link to print screen

    https://drive.google.com/file/d/1lysMmKlJuEg7Tihqh1AVBhgjLavQn-OH/view?usp=sharing

    Thank so much. Thanks

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Change ‘Shipping’ to ‘Delivery’’ is closed to new replies.