Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1418339

    JamesZL
    Participant

    Hi X Theme Support

    How do I change the woocommerce cart widget (which I’ve added on the right side in the shop) text “no products in the cart” to something else?

    Thank you!

    #1418341

    JamesZL
    Participant
    This reply has been marked as private.
    #1418691

    Rue Nel
    Moderator

    Hello There,

    Thanks for writing in! To resolve this issue, assuming that the child theme is set up, please add the following code in your child theme’s functions.php file

    // Change Cart Totals
    // =============================================================================
    function change_no_product_text($translated) { 
      $translated = str_ireplace('No products in the cart.', 'insert your translation here', $translated);
      return $translated; 
    }
    add_filter('gettext', 'change_no_product_text' );
    // =============================================================================

    We would loved to know if this has work for you. Thank you.

    #1418852

    JamesZL
    Participant

    Hi

    I added the code to my child theme’s functions.php but it didn’t work

    Any idea why that could be?

    EDIT:

    It works now! Apparently I just had to give it a little time!

    Great job!

    #1418968

    Paul R
    Moderator

    Glad to know it works. Have a nice day!