{"id":2155,"date":"2019-07-26T15:22:29","date_gmt":"2019-07-26T19:22:29","guid":{"rendered":"https:\/\/www.thatsoftwareguy.com\/blog\/?p=2155"},"modified":"2019-07-26T15:22:29","modified_gmt":"2019-07-26T19:22:29","slug":"reversing-item-order-in-the-zen-cart-shopping-cart","status":"publish","type":"post","link":"https:\/\/www.thatsoftwareguy.com\/blog\/2019\/07\/26\/reversing-item-order-in-the-zen-cart-shopping-cart\/","title":{"rendered":"Reversing item order in the Zen Cart Shopping Cart"},"content":{"rendered":"\n<p>By default, items in your shopping cart in Zen Cart are shown in the order they are added to the cart.  The first one is at the top, the second is below that, and so forth. <\/p>\n\n\n\n<p>Generally this is desirable, but if your business involves taking telephone orders, especially of long lists of products, it&#8217;s easy to reverse it to show the last item added first instead. This can be useful for confirming as you add item by item. <\/p>\n\n\n\n<p>Modify the file<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">includes\/templates\/YOUR_TEMPLATE\/templates\/tpl_shopping_cart_default.php<\/pre>\n\n\n\n<p>Look for <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">foreach ($productArray as $product) {<\/pre>\n\n\n\n<p>and change this to <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$productArray = array_reverse($productArray);<br>foreach ($productArray as $product) {<\/pre>\n\n\n\n<p>And you&#8217;re done!  Items will now appear in the opposite order &#8211; last added, first shown. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default, items in your shopping cart in Zen Cart are shown in the order they are added to the cart. The first one is at the top, the second is below that, and so forth. Generally this is desirable, but if your business involves taking telephone orders, especially of long lists of products, it&#8217;s &hellip; <a href=\"https:\/\/www.thatsoftwareguy.com\/blog\/2019\/07\/26\/reversing-item-order-in-the-zen-cart-shopping-cart\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Reversing item order in the Zen Cart Shopping Cart<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58,78],"tags":[],"class_list":["post-2155","post","type-post","status-publish","format-standard","hentry","category-that-software-guy","category-zen-cart"],"_links":{"self":[{"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/posts\/2155","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/comments?post=2155"}],"version-history":[{"count":2,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/posts\/2155\/revisions"}],"predecessor-version":[{"id":2157,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/posts\/2155\/revisions\/2157"}],"wp:attachment":[{"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/media?parent=2155"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/categories?post=2155"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/tags?post=2155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}