Empty Cart Button for WooCommerce makes the e-commerce store outstanding. International Standards for making the Cart Clear or Empty is natural. If Filled then How Customer removes every Product from Cart One-by-One. That’s very difficult for clients or customers. So the Empty Cart option provides/facilitates that can be cleared by just only One Click. ICONIFERz provide you the option for designer or developer makes it Possible to your e-commerce Store as International Standards. It is necessary that Website is developing or designing in WordPress and your Store is belong to WooCommerce store.

Steps

  • Open You WordPress Admin Page
  • From Sidebar select “Appearance” then “Theme Editor
  • From “Theme Files” select “functions.php
  • Past the below code in function.php.
add_action( 'init', 'woocommerce_clear_cart_url' ); function woocommerce_clear_cart_url() { if ( isset( $_GET['clear-cart'] ) ) { global $woocommerce; $woocommerce->cart->empty_cart(); } }
  • Open the Home Page/Cart Page
  • Palace the Button or Text Field
  • Add the link like that for Home Page >> https://yourwebsite.com/?clear-cart
  • Add the link like that for Cart Page >> https://yourwebsite.com/cart/?clear-cart

If this code is not Working then Install the regular Plugin “Code Snippets

  • Add new Snippet
  • Paste the Above Code
  • Add the URL to the Button or Text Link.
Categories: Website Design| By |

One Comment

  1. f8ed33659aa6cf8c3f1f578b827e8970?s=54&d=mm&r=g
    gate.io March 25, 2023 at 3:50 AM - Reply

    Reading your article has greatly helped me, and I agree with you. But I still have some questions. Can you help me? I will pay attention to your answer. thank you.

Leave A Comment

Related

Subscribe to get Latest News and Tech Deals of the week

We're committed to your privacy. iCONIFERz uses the information you provide to us to contact you about our relevant content, and services. You may unsubscribe at any time.

Join Us

Google News Icon, iconiferz
Flipboard Icon, iconiferz

Online Tools

iCONIFERz,Online Services for Business, Web Designing, Social Media Marketing, Web Design
Learn Skills Online could just one click away ……

Latest Post