• Resolved leon2068

    (@leon2068)


    Hi There-

    On the single product page, once I click the ‘add to cart’ button, it comes with a notification that ‘[product] has been added to your cart’ and there is a view cart button beside.

    Now my question is, how can I change the notification text and remain the ‘view cart’ button but change the ‘view cart’ text as well?

    Thank you in advance!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    Hi there! ??

    The easiest way to change the text strings in the core WooCommerce plugin is to use a plugin like https://www.ads-software.com/plugins/loco-translate/.

    For more information on how that works, have a look at the following guide: https://docs.woocommerce.com/document/woocommerce-localization/

    I hope that helps ??

    Thread Starter leon2068

    (@leon2068)

    Hi~ Thanks for your reply.

    Actually I have tried to use the plugin before but failed, I just read the guide article again but I still as confused as last time. The guide is all about language translation, isn’t it?

    I don’t want to do any language translation.

    Is it possible to insert some code to php.file to achieve it?

    Thank you.

    If you use Loco to change one string in your standard language file, you will create a custom language. If you save this language file in the normal location, it will be overwritten the next time Woo update the plugin. If you save it in the custom location, it will be protected from being overwritten, but you will need to update it yourself whenever Woo bring out new strings. This would be a burden. The Loco documentation explains the custom location.

    Instead you can use the Say What? plugin:
    https://www.ads-software.com/plugins/say-what/

    Go to Dashboard > Tools and set up text replacements. The settings would be:
    Original string: %s has been added to your cart.
    (must be exact, must be the text when English (United States) is the site language)
    Domain: woocommerce
    Context:
    (leave empty)
    Replacement string: %s has been put in your basket.
    (your choice of words of course. %s is replaced with the number at run time.)

    You’ll need a second text replacement for the plural case.
    Original string: %s have been added to your cart.

    You can do the the same thing with the gettext filter in your child theme’s functions.php, but that would be more effort and of no extra benefit.

    Thread Starter leon2068

    (@leon2068)

    Problem solved!

    Thank you soosososososoosososos much Lorro! (Thumb up)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘customize add to cart notice’ is closed to new replies.