Support » Plugin: Custom Buttons for WooCommerce - Add To Cart » Just Doesn’t Work

  • Resolved DivaVocals

    (@divavocals)


    Installed easy. Configuration was easy.

    – Enable Customizer = Checked
    – Change Buttons on (Single Products) = Checked
    – Change Buttons on (Shop & Archive Pages) = Checked

    But nothing happens.. *shrug*

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Morgan Hvidt

    (@morganhvidt)

    Hi, I tried to reply to your email but it bounced back.

    What theme are you running? By default the button should say “Add to cart”. I suspect your theme overrides the defaults with its own code to display “buy”, which is why the Button Customizer isn’t taking affect.

    I’d recommend that you contact the theme developer and ask how to change it. If you are lucky then they might be able to supply you with a simple filter (code) to drop into your child theme.

    You then shouldn’t need our plugin. Running less plugins is always good if you are able to do so.

    I hope that points you in the right direction 🙂

    Thread Starter DivaVocals

    (@divavocals)

    I am using the 9Seeds Jessica theme: https://9seeds.com/product/jessica/

    I have reached out to the theme support team to see if they can assist. Will update this post with the results as soon as I hear from them.

    Thread Starter DivaVocals

    (@divavocals)

    So it looks like the Jessica theme has this code lines 44-46 in the “/themes/jessica/lib/shop/woocommerce.php file” file:

    // Change add to cart button text
    add_filter( 'add_to_cart_text', 'wsm_woo_custom_cart_button_text' ); // < 2.1
    add_filter( 'woocommerce_product_single_add_to_cart_text', 'wsm_woo_custom_cart_button_text' ); // 2.1+ Single
    add_filter( 'woocommerce_product_add_to_cart_text', 'wsm_woo_custom_cart_button_text' ); // 2.1 + Archives
    function wsm_woo_custom_cart_button_text() {
    	return __( 'Buy', 'jessica' );
    }

    In THEORY, this code snippet should have removed these filters and allowed the plugin to work:

    // Remove Jessica add to cart button filter (See /themes/jessica/lib/shop/woocommerce.php file lines 44-46 for the original button filter code)
    remove_filter( 'add_to_cart_text', 'wsm_woo_custom_cart_button_text' ); // < 2.1
    remove_filter( 'woocommerce_product_single_add_to_cart_text', 'wsm_woo_custom_cart_button_text' ); // 2.1+ Single
    remove_filter( 'woocommerce_product_add_to_cart_text', 'wsm_woo_custom_cart_button_text' ); // 2.1 + Archives

    Unfortunately, adding and activating that snippet doesn’t work, but commenting out the code on lines 44-46 in the “/themes/jessica/lib/shop/woocommerce.php file” allows this plugin to work. It’s not ideal because now I have to keep track of this change EVERY time I update this theme. So far the theme author hasn’t responded, but I now know this issue is NOT this plugn, but my theme. **SMH**

    Plugin Author Morgan Hvidt

    (@morganhvidt)

    Thanks for the update @divavocals and the snippets! I can see that should be able to override the filters by forcing a higher priority on mine. I’ll release an update soon. Let me know if it works for you 🙂

    Thread Starter DivaVocals

    (@divavocals)

    Wow, if you could make that update that would be AWESOME!!

    Thread Starter DivaVocals

    (@divavocals)

    @morganhvidt just saw the update, works PERFECT with my code snippet to remove the theme’s button text filters! Thank you thank you thank you!!!

    Plugin Author Morgan Hvidt

    (@morganhvidt)

    @divavocals you are welcome, Glad to hear that it works for you! Maybe you’d consider being the first to leave a review? 😁
    Thanks!

    Thread Starter DivaVocals

    (@divavocals)

    Done! Thanks again!!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Just Doesn’t Work’ is closed to new replies.