Website Building » WooCommerce » How Do I Display the WooCommerce Cart Icon?

How Do I Display the WooCommerce Cart Icon?

Last updated on January 15, 2023 @ 7:19 pm

If you’re using the WooCommerce plugin for WordPress, you may want to display the WooCommerce cart icon on your site. There are a few different ways to do this.

One way is to use a shortcode. To do this, simply add the following shortcode to the location on your site where you want the cart icon to appear:

[woocommerce_cart_icon]

If you want to style the cart icon, you can do so by adding the following CSS to your theme’s stylesheet:

PRO TIP: If you are using a WooCommerce theme, it is likely that your theme already has a cart icon displayed somewhere on the page. If you are using a WooCommerce plugin, you may need to add a shortcode or widget to your page to display the cart icon.
.woocommerce-cart-icon {
float: right;
margin: 0 10px 0 0;
}

You can also display the WooCommerce cart icon by adding a widget to your sidebar. To do this, go to Appearance > Widgets and drag the WooCommerce Cart widget into the sidebar. This will automatically display the cart icon with a link to your cart page. You can also add the cart icon to your site’s header or navigation menu. To do this, go to Appearance > Menus and add a Custom Link to your menu with the following URL:

http://example.com/?wc-ajax=get_refreshed_fragments

Replace “example.com” with your own domain name. This will add a link to your cart page in your navigation menu with the cart icon next to it.

Madison Geldart

Madison Geldart

Cloud infrastructure engineer and tech mess solver.