Support » Plugin: WooCommerce » 'Add to cart" changed but not all across…

  • Changed the button text of with this code

    add_filter( ‘single_add_to_cart_text’, ‘yoursite_single_cart_text’, 10, 1 );
    function yoursite_single_cart_text( $button_text ) {
    $button_text = ‘Take This Class’;
    return $button_text;
    }

    However, the text is only changed on the single product page itself and not on the main product page.
    Any ideas?

    I am aware that changing texts makes more sense on Localisation, but I have not gotten there yet…

    Thanks tons

    http://wordpress.org/extend/plugins/woocommerce/

Viewing 14 replies - 1 through 14 (of 14 total)
  • Roy Ho

    (@splashingpixelscom)

    Use this filter:

    'add_to_cart_text'

    Thread Starter cerrone

    (@cerrone)

    Thanks.

    I have now played around with all those three filters but it does not work. Which one shall I keep, which one delete in the code above?

    Thanks

    Roy Ho

    (@splashingpixelscom)

    You keep both. One is for the add to cart text on single product page and the other is for the category add to cart text…

    Thread Starter cerrone

    (@cerrone)

    hey again, to what file would I need to add/remove the code. I looked around my functions.php but dont find those lines. I still have the chanced text on my site though.

    is there a php file for custom code?

    Roy Ho

    (@splashingpixelscom)

    Its the same thing what you did from your OP except you’re doing it again for the filter that I mentioned.

    Thread Starter cerrone

    (@cerrone)

    Excuse me but I dont understand your answer. In order to use this filter I need to know where I find that file ‘functions.php’. I have one in my wordpress/wp-includes but opening that file, I dont find the custom code in that file.

    Thread Starter cerrone

    (@cerrone)

    referring to that code above.
    from
    http://bryceadams.com/

    Thread Starter cerrone

    (@cerrone)

    Roy Ho

    (@splashingpixelscom)

    Again, you put the code from your OP into your themes functions.php file. Do it twice, one for the OP filter and one for the filter I mentioned. You only need 2 filters but you can have one function. Both filters can reference the same function.

    Thread Starter cerrone

    (@cerrone)

    OP?

    Thread Starter cerrone

    (@cerrone)

    found the file. thanks.

    my issue is actually something bigger:
    the product overview only shows a “add to cart” button. Now, people will not just add everything to a cart without seeing details.
    however, the peddlar theme does NOT provide more buttons next to the product img (product overview, not product detail page)

    see this:
    http://cl.ly/image/461r3r3N181v

    with mouse over:
    http://cl.ly/image/2r3v0c3d0T37

    this is VERY bad on mobile since there is no mouseover.

    since I cannot just change the function of button “add to cart” I like to add an other button, eg “see details”

    Thread Starter cerrone

    (@cerrone)

    Would be great if you could help.

    this guy has 3 buttons:
    http://www.fantasyattic.com/costumes

    Roy Ho

    (@splashingpixelscom)

    ….You need to start a new thread as your OP = “original post” ( everyone uses this acronym for original post ) is asking about changing the text of the add to cart button. Now it seems you want something else. So I suggest you close this thread and start a new one.

    Thread Starter cerrone

    (@cerrone)

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘'Add to cart" changed but not all across…’ is closed to new replies.