{"id":11810,"date":"2016-02-16T09:47:56","date_gmt":"2016-02-16T09:47:56","guid":{"rendered":"https:\/\/www.megamenu.com\/documentation\/pro-features\/menu-logo-3\/"},"modified":"2020-05-06T15:13:24","modified_gmt":"2020-05-06T14:13:24","slug":"woocommerce","status":"publish","type":"ht_kb","link":"https:\/\/www.megamenu.com\/documentation\/woocommerce\/","title":{"rendered":"WooCommerce"},"content":{"rendered":"<p>In this guide we&#8217;ll bring together many of the options available within Max Mega Menu to display a WooCommerce cart icon with &#8220;ajax enabled&#8221; cart totals.<\/p>\n<h3>How to add a WooCommerce Cart Total to your Menu<\/h3>\n<h4>Create a new menu item for the cart total<\/h4>\n<p>To add a WooCommerce Cart total\u00a0to your menu, first add the Cart menu item to your menu:<\/p>\n<p><a href=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-add-menu-item.png\" rel=\"attachment wp-att-11812\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11812\" src=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-add-menu-item.png\" alt=\"woocommerce-add-menu-item\" width=\"1264\" height=\"793\" \/><\/a><\/p>\n<h4>Open the mega menu settings<\/h4>\n<p>Position the menu item where you&#8217;d like the Cart item\u00a0to appear and click the Save Menu button, then\u00a0open the Mega Menu settings for the item:<\/p>\n<p><a href=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-open-settings.png\" rel=\"attachment wp-att-11813\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11813\" src=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-open-settings.png\" alt=\"woocommerce-open-settings\" width=\"1264\" height=\"793\" \/><\/a><\/p>\n<h4>Set a &#8216;Cart&#8217; Icon for the menu item<\/h4>\n<p>Select a suitable icon for the menu item. In this case we&#8217;re using the Cart icon from Dashicons, but you can select one from Font Awesome if you prefer, or upload your own icon.<\/p>\n<p><a href=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-icon.png\" rel=\"attachment wp-att-11815\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11815\" src=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-icon.png\" alt=\"woocommerce-icon\" width=\"1264\" height=\"793\" \/><\/a><\/p>\n<p><em>You can adjust the styling of the icon (size, colour etc) within the Styling tab<\/em><\/p>\n<p>In the Settings tab, enable the &#8220;Hide Text&#8221; option so we only see the Cart icon in the menu.<\/p>\n<p><a href=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-cart-hide-text.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-242683\" src=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-cart-hide-text.png\" alt=\"\" width=\"2506\" height=\"1500\" srcset=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-cart-hide-text.png 2506w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-cart-hide-text-300x180.png 300w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-cart-hide-text-1024x613.png 1024w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-cart-hide-text-768x460.png 768w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-cart-hide-text-50x30.png 50w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-cart-hide-text-1536x919.png 1536w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-cart-hide-text-2048x1226.png 2048w\" sizes=\"auto, (max-width: 2506px) 100vw, 2506px\" \/><\/a><\/p>\n<h4>Output the Cart Total as a Menu Item Badge<\/h4>\n<p>Click the <a href=\"https:\/\/www.megamenu.com\/documentation\/badge\/\">Badge<\/a> tab and paste one or both of the following shortcodes into the &#8220;Badge Text&#8221; field to display your cart count\/total:<\/p>\n<p><span class=\"lang:default decode:true crayon-inline \"><\/span><\/p>\n<p><span class=\"lang:default decode:true crayon-inline\"><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-menu-item-badge.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-242686\" src=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-menu-item-badge.png\" alt=\"\" width=\"2506\" height=\"1500\" srcset=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-menu-item-badge.png 2506w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-menu-item-badge-300x180.png 300w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-menu-item-badge-1024x613.png 1024w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-menu-item-badge-768x460.png 768w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-menu-item-badge-50x30.png 50w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-menu-item-badge-1536x919.png 1536w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-menu-item-badge-2048x1226.png 2048w\" sizes=\"auto, (max-width: 2506px) 100vw, 2506px\" \/><\/a><\/p>\n<p><em>There are 4 built in styles for menu item badges, which can be edited under Mega Menu &gt; Menu Themes &gt; Badge.<\/em><\/p>\n<h3>Final Result<\/h3>\n<p><a href=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-cart-total.png\" rel=\"attachment wp-att-11816\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11816\" src=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-cart-total.png\" alt=\"woocommerce-cart-total\" width=\"1264\" height=\"793\" data-wp-editing=\"1\" \/><\/a><\/p>\n<h2>Displaying a Cart Widget below the cart total<\/h2>\n<p>\u200bYou can add a WooCommerce cart widget to the sub menu of your cart total menu item (see &#8220;Displaying Widgets in a mega menu: <a href=\"https:\/\/www.megamenu.com\/documentation\/mega-menus\/\">https:\/\/www.megamenu.com\/documentation\/mega-menus\/<\/a>).<\/p>\n<p><a href=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2017\/05\/woocommerce-cart-widget.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-112668\" src=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2017\/05\/woocommerce-cart-widget.png\" alt=\"\" width=\"2404\" height=\"1736\" \/><\/a><br \/>\n\u200b<br \/>\nIf you wish to make the\u00a0sub menu containing the cart narrower, see:\u00a0<a href=\"https:\/\/www.megamenu.com\/documentation\/change-width-individual-sub-menu\/\">https:\/\/www.megamenu.com\/documentation\/change-width-individual-sub-menu\/<\/a><\/p>\n<p><a href=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-cart-below.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-242697\" src=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-cart-below.png\" alt=\"\" width=\"2506\" height=\"1500\" srcset=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-cart-below.png 2506w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-cart-below-300x180.png 300w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-cart-below-1024x613.png 1024w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-cart-below-768x460.png 768w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-cart-below-50x30.png 50w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-cart-below-1536x919.png 1536w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2016\/02\/woocommerce-cart-below-2048x1226.png 2048w\" sizes=\"auto, (max-width: 2506px) 100vw, 2506px\" \/><\/a><\/p>\n<h2>Adding a cart count to the Mobile Toggle Bar<\/h2>\n<p>To show the WooCommerce cart count in the mobile toggle bar, add 2 mobile toggle blocks:<\/p>\n<ol>\n<li>An icon block set to the Cart icon<\/li>\n<li>An HTML block showing the WooCommerce shortcode <span class=\"lang:default decode:true crayon-inline\"><\/span><\/li>\n<\/ol>\n<p><a href=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/03\/woocommerce-toggle-block.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-148761\" src=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/03\/woocommerce-toggle-block.png\" alt=\"\" width=\"2332\" height=\"1548\" srcset=\"https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/03\/woocommerce-toggle-block.png 2332w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/03\/woocommerce-toggle-block-300x199.png 300w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/03\/woocommerce-toggle-block-768x510.png 768w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/03\/woocommerce-toggle-block-1024x680.png 1024w, https:\/\/www.megamenu.com\/wp-content\/uploads\/2018\/03\/woocommerce-toggle-block-50x33.png 50w\" sizes=\"auto, (max-width: 2332px) 100vw, 2332px\" \/><\/a><\/p>\n<p>The HTML block displaying the cart count will not have any specific styling attached to it. If you wish to adjust the styling, go to <em>Mega Menu &gt; Menu Themes &gt; Custom Styling<\/em> and add the following:<\/p>\n<pre class=\"lang:default decode:true \">#{$wrap} .mega-toggle-block .mega-menu-woo-cart-count {\r\n   color: white;\r\n   font-size: 12px;\r\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide we&#8217;ll bring together many of the options available within Max Mega Menu to display a WooCommerce cart icon with &#8220;ajax enabled&#8221; cart totals. How to add a WooCommerce Cart Total to your Menu Create a new menu item for the cart total To add a WooCommerce Cart&#8230;<\/p>\n","protected":false},"author":1,"comment_status":"open","ping_status":"open","template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","footnotes":""},"ht-kb-category":[16],"ht-kb-tag":[],"class_list":["post-11810","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-pro-features"],"uagb_featured_image_src":[],"uagb_author_info":{"display_name":"Tom Hemsley","author_link":"https:\/\/www.megamenu.com\/author\/megamenu\/"},"uagb_comment_info":0,"uagb_excerpt":"In this guide we&#8217;ll bring together many of the options available within Max Mega Menu to display a WooCommerce cart icon with &#8220;ajax enabled&#8221; cart totals. How to add a WooCommerce Cart Total to your Menu Create a new menu item for the cart total To add a WooCommerce Cart...","_links":{"self":[{"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/ht-kb\/11810","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/comments?post=11810"}],"version-history":[{"count":18,"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/ht-kb\/11810\/revisions"}],"predecessor-version":[{"id":242706,"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/ht-kb\/11810\/revisions\/242706"}],"wp:attachment":[{"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/media?parent=11810"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/ht-kb-category?post=11810"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.megamenu.com\/wp-json\/wp\/v2\/ht-kb-tag?post=11810"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}