Updated on March 16, 2020

This members-only tutorial provides the steps to set up total cost and cart icon with number of items linking to the /cart page when using WooCommerce in Oxygen.

The cart total and item count are dynamic i.e., will automatically get updated via Ajax as items are added/removed from the cart.

For the cart icon we are going to use inline SVG from Font Awesome Pro.

We shall also ensure that these appear only if there is at least one product in the cart.

Step 1

Let's add the code that shows the "initial" cart total and count. This will reflect whatever is already in the user's cart.

Edit your Main Catch All Template with Oxygen.

Add a Code Block where you want to show the dynamic cart. In my test site, I added it below (appearing to the right of) the Menu component inside a Header Row of Header Builder.


This is a premium members-only content.

To view the rest of the content, please sign up for membership ($37/month or $399 one-time).

Already a member? Log in below or here.

Need help implementing a tutorial in your site or want to hire me for custom work?


Find the article helpful and wish to donate?



For adding code blocks wrap the code in three backticks. Markdown should work.
Provide a URL of your site/webpage if something is not working.

2 comments on “WooCommerce Cart Total and Item Count in Oxygen”

  1. Thanks for this great tutorial. I’d like to show the shopping cart at all times. I tried some variations of this code but can’t seem to get it to work. Would love to see a snippet added for this.

linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram
%d bloggers like this: