{"id":2967,"date":"2014-06-25T04:55:52","date_gmt":"2014-06-25T04:55:52","guid":{"rendered":"http:\/\/www.tipsandtricks-hq.com\/ecommerce\/?p=2967"},"modified":"2023-10-19T12:19:08","modified_gmt":"2023-10-19T01:19:08","slug":"wp-shopping-cart-stacking-multiple-product-boxes-side-by-side","status":"publish","type":"post","link":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-shopping-cart-stacking-multiple-product-boxes-side-by-side-2967","title":{"rendered":"WP Shopping Cart &#8211; Stacking Multiple Product Boxes Side by Side"},"content":{"rendered":"<p>I received the following question today from one user:<\/p>\n<p><strong><em><span style=\"color: #222222;\">I love the display box feature, yet I cannot get them to align horizontally on the page. How can I get more that one item per line?<\/span><\/em><\/strong><\/p>\n<p>In this tutorial I will explain how you can stack the product boxes side by side to display multiple products in one line.<\/p>\n<h2>Preparation<\/h2>\n<p>If you don&#8217;t know how to create a product box using the WP Shopping Cart plugin then <a href=\"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/how-to-show-a-product-display-box-2278\">read this page<\/a> first.<\/p>\n<h2>CSS Tweaks<\/h2>\n<p>I am going to apply a few custom CSS tweaks to stack the product boxes horizontally.<\/p>\n<p><strong>Step 1)<\/strong> Grab <a href=\"https:\/\/www.tipsandtricks-hq.com\/wordpress-custom-css-plugin-6413\">this custom css plugin<\/a> (it allows you to add your custom CSS code without modifying the main plugin).<\/p>\n<p><strong>Step 2)<\/strong>\u00a0Lets make the product boxes narrower so there is more room to have multiple boxes side by side.<\/p>\n<p>Add the following block of CSS code in the custom CSS plugin&#8217;s interface to define a maximum width of 250px for the boxes.<\/p>\n<pre>.wp_cart_product_display_box{\nmax-width: 250px;\n}<\/pre>\n<p>You can use a different value if you want to make it narrower.<\/p>\n<p><strong>Step 3)<\/strong> Lets float the product boxes so they stack. Add the following CSS code just below the max-width that you defined in step 2:<\/p>\n<pre>float: left;\n<\/pre>\n<p>You should have the following combined CSS code and the boxes should be stacked side by side now:<\/p>\n<pre>.wp_cart_product_display_box{\nmax-width: 250px;\nfloat: left;\n}<\/pre>\n<p><strong>Step 4)<\/strong> Finally, lets give it some margin to add some space between the boxes.<\/p>\n<p>Add the following CSS code just below what you defined in step 3:<\/p>\n<pre>margin-right: 10px;\n<\/pre>\n<p>You should have the following combined CSS which is the final code<\/p>\n<pre>.wp_cart_product_display_box{\nmax-width: 250px;\nfloat: left;\nmargin-right: 10px;\n}<\/pre>\n<h2>The Final Output<\/h2>\n<p>The final output should look like the following example (your product boxes will be aligned horizontally):<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2968\" src=\"http:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-content\/uploads\/2014\/06\/shopping-cart-grid-product-boxes-example.jpg\" alt=\"shopping-cart-grid-product-boxes-example\" width=\"524\" height=\"397\" srcset=\"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-content\/uploads\/2014\/06\/shopping-cart-grid-product-boxes-example.jpg 524w, https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-content\/uploads\/2014\/06\/shopping-cart-grid-product-boxes-example-300x227.jpg 300w\" sizes=\"(max-width: 524px) 100vw, 524px\" \/><\/p>\n<p>Our WP eStore plugin has more product display templates and better grid layout options. You can check the styles offered in WP eStore by <a href=\"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/stylish-product-display-options-for-wp-estore-829\">visiting this page<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I received the following question today from one user: I love the display box feature, yet I cannot get them to align horizontally on the page. How can I get more that one item per line? In this tutorial I will explain how you can stack the product boxes side by side to display multiple [&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":[173,172,150,56,32],"class_list":{"0":"post-2967","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-wordpress-shopping-cart","7":"tag-e-commerce","8":"tag-grid-layout","9":"tag-product-box","10":"tag-product-display","11":"tag-wp-shopping-cart","12":"entry"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/posts\/2967"}],"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=2967"}],"version-history":[{"count":0,"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/posts\/2967\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/media?parent=2967"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/categories?post=2967"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tipsandtricks-hq.com\/ecommerce\/wp-json\/wp\/v2\/tags?post=2967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}