WordPress.org

Forums

WooCommerce - excelling eCommerce
[resolved] Changing "Add to cart" text (4 posts)

  1. amizomi
    Member
    Posted 7 months ago #

    I would like to change the "Add to cart" button into my own text. Because it becomes too long in my language and therefore messes up the view from a mobile.
    Is this possible?
    Im using the Twenty Fourteen theme if it makes any difference and the link to the problem is:

    https://wordpress.org/plugins/woocommerce/

  2. dolliv
    Member
    Posted 7 months ago #

    This might help you, if you're not afraid of adding some custom code to the functions.php of your theme:

    Change add to cart button text

  3. terrytsang
    Member
    Posted 7 months ago #

    Hi @amizomi, you can add below code into your theme functions.php:

    add_filter( 'add_to_cart_text', 'custom_cart_button_text' );
    add_filter( 'woocommerce_product_single_add_to_cart_text', 'custom_cart_button_text' );
    add_filter( 'woocommerce_product_add_to_cart_text', 'custom_cart_button_text' ); 
    
    function custom_cart_button_text() {
      return __( 'Your Add to Cart Text', 'woocommerce' );
    }
  4. amizomi
    Member
    Posted 7 months ago #

    Thanks a lot guys! It worked:)

Reply

You must log in to post.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.