remove product item from woocommerce checkout page

Remove product item from woocommerce checkout page

Many of our clients recently wanted to add an option to remove product item from woocommerce checkout page in the order details section. They are using kind of website where cart page is useless. They redirect users to checkout page after successful add to cart.

But woocommerce doesn’t have the default option to remove the product at the checkout like the cart page. In this tutorial, we will be showing how to add the option easily.

1. Create a folder in your theme’s root directory and name it “woocommerce”.  The templates in this folder will overwrite woocommerce default templates.  If you edit the woocommerce default templates in the plugins folders, the future update will wipe all the changes. So, it’s recommended to use by creating the folder inside the theme.

 

2. Create another folder in the woocommerce folder and name it “checkout”. Copy the review-order.php file from the woocommerce plugin and paste into this folder.

 

3. Open the review-order.php in a text editor. Then add the following codes before the product name of the table like the picture. It will add a heading in the product details section like “Product”, “Total”.

paste-to-checkout

 

You can find the codes from templates/cart/cart.php in the plugins folder at the line number 33.

 

4. Now we have to add a link and icon to remove the products. Open the cart.php file from the plugins templates folder. Copy the following codes from the line number 54.

 

5. Paste the code just before the product name.

paste-main-code

I hope it will help you. Feel free to comment if you have any questions.

5 Replies to “Remove product item from woocommerce checkout page”

Leave a Reply

Your email address will not be published. Required fields are marked *

Ready to Get Started?

Let’s talk about your project. Contact us today and we’ll get back to you soon.