{"id":2925,"date":"2014-05-29T00:38:07","date_gmt":"2014-05-29T00:38:07","guid":{"rendered":"http:\/\/www.tipsandtricks-hq.com\/ecommerce\/?p=2925"},"modified":"2025-11-23T10:43:55","modified_gmt":"2025-11-22T23:43:55","slug":"simple-cart-showing-a-compact-shopping-cart","status":"publish","type":"post","link":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/simple-cart-showing-a-compact-shopping-cart-2925","title":{"rendered":"Simple Cart &#8211; Showing a Compact Shopping Cart"},"content":{"rendered":"<p>Sometimes you may want to display a compact shopping cart on your sidebar or in a post. This allows the users to see that they have items in the cart and they can click a view cart button to go to the full shopping cart page.<\/p>\n<p>Use the following shortcode where you want to show the compact shopping cart:<\/p>\n<p>[wp_compact_cart]<\/p>\n<p>You can add this shortcode in a standard text widget to add the compact cart to the sidebar of your theme.<\/p>\n<p>When there are no items in the cart, the shorcode will produce the following output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2923\" src=\"http:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-content\/uploads\/2014\/05\/compact-cart-shortcode-output-for-empty-cart.png\" alt=\"compact-cart-shortcode-output-for-empty-cart\" width=\"263\" height=\"59\" \/><\/p>\n<p>When users add item(s) to the cart, it will show a compact shopping cart output like the following:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2924\" src=\"http:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-content\/uploads\/2014\/05\/compact-cart-shortcode-output-items-in-cart.png\" alt=\"compact-cart-shortcode-output-items-in-cart\" width=\"266\" height=\"56\" \/><\/p>\n<p>Clicking the &#8220;view cart&#8221; link will take them to the page that you specified in the &#8220;<strong>Checkout Page URL<\/strong>&#8221; field of the plugin settings.<\/p>\n<h2>Compact Cart Style 2<\/h2>\n<p>This second compact cart uses a different style than the one mentioned above. It looks like the following example:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4199\" src=\"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-content\/uploads\/2014\/05\/simple-cart-compact-cart-2-example.png\" alt=\"simple-cart-compact-cart-2-example\" width=\"156\" height=\"46\" \/><\/p>\n<p>To use this compact cart on your site, use the following shortcode:<\/p>\n<p>[wp_compact_cart2]<\/p>\n<p>You can add this shortcode in a standard text widget to add it to the sidebar of your site.<\/p>\n<h2>Creating a Specific Checkout Page for Your Site<\/h2>\n<p>You should create a checkout page before using the compact cart shortcode. Here is how to do it (if you haven&#8217;t done it already):<\/p>\n<p><strong>Step 1)<\/strong> Create a new WordPress page<\/p>\n<p><strong>Step 2)<\/strong> Add the following shortcode to this newly created page<\/p>\n<p>[always_show_wp_shopping_cart]<\/p>\n<p><strong>Step 3)<\/strong> Go to the plugin settings and specify the URL of this newly created page in the &#8220;<strong>Checkout Page URL<\/strong>&#8221; field.<\/p>\n<h2>Showing a Compact Cart In Your Theme&#8217;s Header<\/h2>\n<p>Add the following code in your &#8220;header.php&#8221; file to show a compact cart in your theme&#8217;s header area:<\/p>\n<pre>&lt;?php echo do_shortcode('[wp_compact_cart]'); ?&gt;\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes you may want to display a compact shopping cart on your sidebar or in a post. This allows the users to see that they have items in the cart and they can click a view cart button to go to the full shopping cart page. Use the following shortcode where you want to show [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[30],"tags":[178,179,32],"class_list":{"0":"post-2925","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-wordpress-shopping-cart","7":"tag-cart-shortcode","8":"tag-compact-cart","9":"tag-wp-shopping-cart","10":"entry"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/posts\/2925"}],"collection":[{"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/comments?post=2925"}],"version-history":[{"count":1,"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/posts\/2925\/revisions"}],"predecessor-version":[{"id":5469,"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/posts\/2925\/revisions\/5469"}],"wp:attachment":[{"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/media?parent=2925"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/categories?post=2925"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/tags?post=2925"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}