最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Add to Cart button displaying twice on Shop Page Woocommerce

programmeradmin1浏览0评论

recently noticed that the add to cart button is appearing twice on my shop page - / . Can't work out if it is conflicting with another plug-in. I had originally added the feature by adding code to the function.php file but now do not see it, so assume it has been overwritten. Have tried adding code to hide but this does not work either. Any suggestions would be helpful.

recently noticed that the add to cart button is appearing twice on my shop page - https://www.widescenes/products/nisi-filters/filter-kits/ . Can't work out if it is conflicting with another plug-in. I had originally added the feature by adding code to the function.php file but now do not see it, so assume it has been overwritten. Have tried adding code to hide but this does not work either. Any suggestions would be helpful.

Share Improve this question asked Oct 25, 2020 at 2:23 HelenHelen 112 bronze badges 2
  • The top one says it's from an Ajax add to cart plugin - do you have something like that, as a plugin or in your theme? Can you search your site's files for 'ajax_add_to_cart'? It's not working though, both add-to-cart buttons refresh the page for me. – Rup Commented Oct 25, 2020 at 13:42
  • The top one is the one I had originally added via function.php, the bottom one is the one that recently started to appear. If the product is a variable it says "select options' instead - widescenes/products/nisi-filters/circular-filters . Silly question but how do I search my site for files 'ajax_add_to_cart"? – Helen Commented Oct 25, 2020 at 23:55
Add a comment  | 

2 Answers 2

Reset to default 1

Thanks for all your help. Have found the issue. It was caused by Pinpoint Booking System. I deactivated and it removed the second row from the shop page.

You can use the Woocommerce hook for remove add to Cart Button:

You can check below this function , Add your functions.php

add_action( 'woocommerce_after_shop_loop_item', 'disable_add_to_cart_buttons', 1 );

    function disable_add_to_cart_buttons() {
      if( is_shop() ) { 
        remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart' );
      }
    }
发布评论

评论列表(0)

  1. 暂无评论