• Hi everyone,

    I just encountered the weirdest problem. The add to cart button shows;

    ‘add to basketadd to cart’

    Now I only need 1 of the 2. I work with Woocommerce. Does anyone know how this could have happened and what I can do to fix it?

    Site: https://www.timhupkes.com/shop

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    Some extension or plugin has used the filter for the button text improperly, adding content instead of replacing it. The filter for this text is ‘woocommerce_product_add_to_cart_text’. To narrow down your search for the offending code, alternately deactivate various plugins and extensions. When the text appears normally, the deactivated code is the culprit.

    When you locate the filter call, you can then use the information to remove the filter after it is added. This way you do not edit the original code and risk your edit disappearing during an update.

    Another way to solve this is hook this filter yourself and return your desired text. Hook the filter with a large priority parameter so your filter will have the final say on the button text.

    Thread Starter Tim Hupkes

    (@tim983)

    @bcworkz
    Thanks! And sorry for being late again (once more I forget to check the notify box…)

    I’ll check out your advice!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘double text in button ‘add to basket’’ is closed to new replies.