{"id":74526,"date":"2016-08-08T09:51:48","date_gmt":"2016-08-08T13:51:48","guid":{"rendered":"http:\/\/www.templatemonster.com\/help\/?p=74526"},"modified":"2016-09-21T04:37:52","modified_gmt":"2016-09-21T08:37:52","slug":"opencart-2-x-how-to-change-products-sort-order","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/opencart-2-x-how-to-change-products-sort-order.html","title":{"rendered":"OpenCart 2.x. How to change products sort order"},"content":{"rendered":"<p>This tutorial shows how to update <strong>products sort order<\/strong> within a category in <a href=\"https:\/\/www.templatemonster.com\/opencart-templates.php\" title=\"OpenCart 2.x.\">OpenCart 2.x.<\/a><\/p>\r\n\r\n <div class=\"video-container\">\r\n\t<iframe src=\"https:\/\/www.youtube.com\/embed\/cpVTnDyiVhg\"><\/iframe>\r\n<\/div>\r\n<p>By default products in <strong>OpenCart<\/strong> are displayed is ascending order, all the products sort order is set to 0.<\/p>\r\n\r\n<ol>\r\n\t<li><p>You can change products order manually by setting each product order in the <strong>Catalog &#8211; Products<\/strong> tab of admin panel.\r\n\t<\/p><\/li>\r\n\t<li>\r\n\t<p>Select a product, open the <strong>Data<\/strong> tab, scroll it down and set the <strong>Sort<\/strong> order. Products with the highest number will be displayed in the end of the list.<\/p><\/li>\r\n\t\r\n\t<li>\r\n\t<p>Refresh the category listing page to see the changes.<\/p><\/li>\r\n\t<li>\r\n\t\t<p>You can also filter catalog by prices. Open the <strong>\/system\/modification\/catalog\/controller\/product<\/strong> folder and edit the <strong>category.php<\/strong> file.<\/p>\r\n\t<\/li>\r\n\t<li>\r\n\t\t<p>Find the <strong>p.sort_order<\/strong> value and change it to <strong>p.price<\/strong>:<\/p>\r\n\t<pre class=\"brush:php\">if (isset($this-&gt;request-&gt;get['sort'])) {\r\n\t\t$sort = $this-&gt;request-&gt;get['sort'];\r\n\t\t} else {\r\n\t\t$sort = 'p.price';\r\n\t}<\/pre>\r\n\t<\/li>\r\n\t<li>\r\n\t\t<p>Save changes in the file. Refresh category page with Ctrl+F5 to preview changes. \r\n\t\t<\/p>\r\n\t<\/li>\r\n\t\r\n<\/ol>\r\n<p>Feel free to check the detailed video tutorial below:<\/p>\r\n<a href=\"http:\/\/www.youtube.com\/watch?v=cpVTnDyiVhg?width=1280&amp;height=720\" rel=\"prettyPhoto\">OpenCart 2.x. How to change products sort order<\/a>","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to update <strong>products sort order<\/strong> within a category in OpenCart 2.x.<\/p>\n","protected":false},"author":65,"featured_media":74527,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1156],"tags":[2285,857,542],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/74526"}],"collection":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/users\/65"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=74526"}],"version-history":[{"count":0,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/74526\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media\/74527"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=74526"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=74526"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=74526"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}