WooCommerce Visual Hook Guide: Cart Page

I’ve put together a visual (yet, you can copy/paste!) hook guide for the WooCommerce Cart Page. If you like this and it is helpful to you, let me know in the comments and I’ll create another one for the checkout, single product page and my account page.

You can find WooCommerce Cart hooks quickly and easily by seeing their actual locations. Great thing is – all you need to do in your functions.php is “add_action(‘place-hook-here’,’your-PHP-function-here’);” and you can place your custom functions anywhere on the WooCommerce Cart Page. Enjoy!

WooCommerce Cart Page [Visual Hook Guide]

Cart

woocommerce_before_cart

woocommerce_before_cart_table

  ProductPriceQuantityTotal
woocommerce_before_cart_contents
× Ciara Bow Earrings Gold Test 6 €5,00
2
€10,00
× Isla ring Test product €1,00
1
€1,00
woocommerce_cart_contents

woocommerce_cart_coupon

woocommerce_after_cart_contents

woocommerce_after_cart_table

woocommerce_cart_collaterals

You may be interested in…

woocommerce_before_cart_totals

Cart Totals

Subtotal€11,00
woocommerce_cart_totals_before_shipping
Shipping

woocommerce_before_shipping_calculator

Calculate Shipping

woocommerce_after_shipping_calculator

woocommerce_cart_totals_after_shipping
woocommerce_cart_totals_before_order_total
Total€18,00
woocommerce_cart_totals_after_order_total

woocommerce_proceed_to_checkout Proceed to Checkout

woocommerce_after_cart_totals

woocommerce_after_cart

WooCommerce Cart Default add_actions


// These are actions you can unhook/remove!

add_action( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display' );
add_action( 'woocommerce_cart_collaterals', 'woocommerce_cart_totals', 10 );
add_action( 'woocommerce_proceed_to_checkout', 'woocommerce_button_proceed_to_checkout', 20 );

Rodolfo Melogli

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as a WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza.

84 thoughts on “WooCommerce Visual Hook Guide: Cart Page

  1. Hello is there a way to remove the ” Shipping to – ‘City'”
    And the “Change address ” part from the Cart menu.
    Here is an image of what I want to remove
    https://drive.google.com/file/d/1WnFR7_UmVpZyx1Xc1rgMnooBtXLanIXz/view?usp=sharing

    1. Hi Aleks, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  2. Excellent! I had been struggling with getting buttons in the right place but solved in a couple of minutes with this guide. Many thanks.

    1. Awesome!

  3. Thank you, very much! Really valuable information.

    1. You’re welcome 🙂

  4. Hi, this article series is great, however, would you be willing to go more into detail? For example here I am missing stuff like “woocommerce_cart_item_name” and so on..

    1. Thanks Kenny, I’ll see what I can do 🙂

  5. Well done Rodolfo.
    Can you please give the snippet to change “Quantity” in woocommerce_before_cart_table. I want to change “Quantity” to “Numbers” in this hook ie existing “Product Price Quantity Total” to “Product Price Numbers Total”.
    Thanks in advance for all such great work.

    1. Hello there, thanks so much for your comment! Yes, this is possible – but unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. Thanks a lot for your understanding! ~R

  6. Hello, thanks for the guide.
    Nevertheless I have a problem I cannot find the solution for.
    In my instance of woocommerce, the last entry in the cart pricing list is the tax amount. I want to show the total amount in the last position instead. Where can you change the order of the cart total prices?

    1. Hello Ruben – thanks so much for your comment! Yes, this is possible – but unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding! ~R

  7. I just found treasure here.. thank you Rodolfo. One question how to remove padding/ margin below breadcrumb and Before cart. Again, Thank you Rodolfo

    1. Hello Brigitte – thanks so much for your comment! You’ll need custom CSS for that 🙂

  8. I am using a plugin which gives graphic variations and I want the variation to show instead of the product image, any idea how this can be achieved?

    1. Hey Mark, thanks so much for your comment! Yes, this is possible – but unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. Thanks a lot for your understanding! ~R

  9. Such a great overview, it helped me a lot!

  10. Hello, the code works fine, could you tell us how to add a space before starting the hook content? the text we give starts only from the hook, we need a space after the hook for proper alignment and better visual appearance!

    1. Hey Malar, thank you for your comment! You can echo any HTML, so try echo a “nbsp” to create a space 🙂

    2. alright, thank you 🙂 Tried using {cart_contents} in email but it is not pulling the data

  11. Thanks – just applied one of the hooks on a job, and have bookmarked this page for future reference.

  12. You are as usual a “go to” when it comes to Woo customization, but i can’t find a way to move the SHIPPING CALCULATOR. I need it either below the Cart Total title or just before the Checkout button. Would that work? What organ can i donate for this, as money is kinda short this days :)) ?!?

    1. Hey B, thanks for your comment! You probably need to use a “filter” for that, that’s all I can suggest 🙂

    2. If a filter doesn’t work, you may have to do it the old-fashioned way and edit the template file.

  13. That’s great !!! Bookmarking it to save my life in the future.

  14. Worked great! Thak you 🙂 🙂

  15. Hi Rodolfo,
    I want to remove the link on the product thumbnail and the product name in the cart page. I used one of your snippets for the same purpose on the shop page, which worked fine, but still don’t understand how to adjust this one to work on the cart page as well. Any suggestions?
    Kind regards, Johan

    1. Hey Johan, thanks for your comment! Unfortunately this is custom work – however you can use this as inspiration: https://businessbloomer.com/woocommerce-remove-permalink-product-order-table/

  16. Hi

    I have tried to add visual hook php code but that isn’t working in storefront child theme i cant see any change in it also it the same case when i trying to add php code cart and checkout page it the same problem

    1. Pankaj, thanks for your comment! What code did you use?

  17. How would I move the Coupon field and button to ‘woocommerce_cart_totals_before_order_total’?
    Thanks, will

    1. Will, thanks for your comment! Have you watched the Cart Customization tutorial? https://businessbloomer.com/woocommerce-visual-hook-guide-cart-page/#comment-25415

  18. It is probably me but I don’t understand.
    What do you mean with ,’your-PHP-function-here’);” ?

    I want to make my cart page a bit more professional looking.

    1. Hey Patrick, thanks for your comment! I recommend you watch this video lesson, it should help: https://businessbloomer.com/customize-cart-page-woocommerce/

  19. Hi, Rodolfo

    I used remove_action( ‘woocommerce_cart_collaterals’, ‘woocommerce_cart_totals’, 10 ); to remove cart totals but nothings happen. I would like to remove that and place below the cart_content same cart layout you use in the video tutorial.

    1. Hey, thanks for your comment! It could be that your theme is already overriding that call, so I’m afraid this is custom work and I cannot provide a complementary solution here on the blog. Thanks a lot for your understanding! ~R

  20. Rodolfo, your visual hook guides have been a life saver for me. I have a question though. I’m using these hooks to add content above the cart, however I notice that it doesn’t work if the cart is empty. Are there hooks specifically for empty carts?

    1. That’s an awesome question Jason! So good that I decided to write a tutorial about it: https://businessbloomer.com/woocommerce-add-content-empty-cart-page/ Hope this helps!

  21. WOW!!! are you The best woo commerce Teacher Ever.
    Can help with a custom checkout gateway ?
    That will be A great Piece

    1. Ahah thanks Paulem, your feedback is much appreciated! Cool, I will put “custom gateway” on my to-do list 🙂 Thank you!

  22. thank you so much

    1. You’re welcome Rahim! 🙂

  23. great guide,, i have questionshow to fix the pay button ?

    1. Hello Arya, thanks for your comment. I’m not sure I entirely understand your point, maybe send me a screenshot to explain. Cheers!

      1. where i send screenshot Mr. rodolfo ?
        cannot post image this here
        thanks for the reply,,i’m very happy

        1. Hey Arya, you can upload screenshots to Dropbox, Screencast.com or similar websites. Then, they’ll give you a link you can paste in a blog comment. Hope this helps!

  24. Thank you so so much. I find myself returning to your site time after time to refer to your guides. Thank you so so much

    1. This is excellent feedback, much appreciated Ewan! Thank you 🙂

  25. Thank you soo much! This guide is soo usefull!

    1. Thank you so much Mick! 🙂

  26. how to remove x(Remove this item) and that column from cart page and replace it under product name in woocommerece cart page

    1. Thanks for your comment Amit! I have an article that might partially help you: https://businessbloomer.com/woocommerce-hide-column-cart-table/.

      In regard to adding the “X” under the product title, unfortunately this is custom development work and I cannot provide this solution on the blog right now. I will add it to my to-write list but I cannot guarantee I will be publishing this before 2-3 months.

      If you would like to get a quote for the fix, feel free to go here to get in touch.

      Thanks for your understanding!

      ~R

  27. This is great, thanks!

    1. You’re welcome Jason 🙂

  28. Hi Rodolfo,

    Great articles you have released for everyone. They helped me a lot in my projects. I also attended your last webinar. Waiting for the next one. Thanks.

    1. Awesome! Thank you so much Manas 🙂

  29. So useful – thankyou 🙂

  30. Thank you so much man, this type of visual presentation really helpful for every one. Thank you so much again.

  31. very very nice

    Thank you !

    1. You’re very welcome Curtis – thanks for sharing your feedback 🙂

  32. A huge THANKS! 🙂
    (I’ve figured out, I wish I could find this before…)

    1. Awesome 🙂 Thank you so much TeeCee!

  33. Please do this for the checkout page aswell 🙂

    1. Thank you Jan! Working on it 🙂

  34. […] visual display in the post provides the hook names, shown in the spots where they apply. Not only is it visual, […]

  35. Awesome resource, you filled a special need! Single Product pretty please with sugar on it!

    1. Ahah thanks again Pam, really appreciate your feedback! Single Product (variable product) will be published tomorrow. Feel free to join the newsletter so that I can notify you when the other pages are published as well. Talk soon 🙂 ~R

  36. […] visual display in the post provides the hook names, shown in the spots where they apply. Not only is it visual, […]

  37. This is a terrific guide! Thank you so much!!!!

    1. Awesome Patty 🙂 Thanks so much for your feedback!

  38. Nice! Excellent job!
    Especially because it’s visual, it’s becomes much more clear where the hooks show up.

    Looking forward to the single page 🙂

    1. Brilliant! Thanks so much for your comment 🙂

  39. Well done Rodolfo, this is a fantastic resource for woo lovers 😀

    1. Thank you Mikel! Your feedback is invaluable 🙂

  40. Love this guide! Can’t wait for the entire suite 😀

    1. Thanks so much Meagan! Glad to know people loved this. I’m so happy 🙂 I’ll keep in touch!

  41. Great guide, feel free to do more of these 🙂

    1. Thank you so much Jan! Keep in touch, as more visual guides will come in the following days! ~R

Questions? Feedback? Support? Leave your Comment Now!
_____

If you are writing code, please wrap it between: [php]code_here[/php]. Failure to complying with this (as well as going off topic) will result in comment deletion. You should expect a reply in about a week - this is a popular blog but I need to get paid work done first. Please consider joining #BloomerArmada to ask me 1-to-1 WooCommerce questions. Thank you :)

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