• Resolved tatennis

    (@tatennis)


    Hi team,

    I would like to customize the text, when I add a product to the cart (woocommerce messages)

    At the moment it just says: Product XYZ was added to your cart!

    How can I customize that?

    Best regards
    Niclas

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Nico

    (@nicolamustone)

    Automattic Happiness Engineer

    Hello there,
    I found an answer to this with an example snippet on StackOverflow: https://stackoverflow.com/questions/53837991/customize-add-to-cart-message-in-woocommerce-3

    Thread Starter tatennis

    (@tatennis)

    Hi Nicola,

    the code works! It is verified! How can modify the code above that it will show “Great choice – “Product name” was added to your cart”

    I also would like to know how it is possible to make the String ready for translation with WPML.

    Best regards Niclas

    Nico

    (@nicolamustone)

    Automattic Happiness Engineer

    Hello,
    Replace

    $added_text = sprintf( _n("%s item has %s", "%s items have %s"

    with

    $added_text = sprintf( _n("Great choice - %s item has %s", "Great choice - %s items have %s"

    Thread Starter tatennis

    (@tatennis)

    Hey Nicola,

    thank you very much for your answer!
    How can I change that for example in the child theme that the string remains after every update?

    Best regards
    Niclas

    Thread Starter tatennis

    (@tatennis)

    Hi Nicola,

    any updates how I can replace the string the best way?

    Best regards
    Niclas

    Plugin Support Damianne P (a11n)

    (@drwpcom)

    Hi @tatennis. Do you still need help with this? If you use an extension like Code Snippets to add snippets to your site instead of adding them to functions.php, they will remain when you update the theme/child theme.

    I realize it took us a while to respond and you may have resolved this issue by now. I’ll leave this thread open for the next 7 days. If we get no updates in the thread by then, I’ll go ahead and resolve it.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to change Woocommerce messages’ is closed to new replies.