{"id":9143168,"date":"2017-05-17T23:55:30","date_gmt":"2017-05-17T23:55:30","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/random-order-wc3\/"},"modified":"2017-05-18T00:37:17","modified_gmt":"2017-05-18T00:37:17","slug":"random-order-wc3","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/random-order-wc3\/","title":{"rendered":"Random order WC3"},"content":{"rendered":"<p>Hello,<\/p>\n<p>I use WooCommerce 2 and updated to the last update of WooCommerce 3.<\/p>\n<p>In my home, I use a random order with a function in functions.php<\/p>\n<pre><code> add_filter(&#039;woocommerce_get_catalog_ordering_args&#039;, &#039;set_sort_order&#039;);\n  function set_sort_order($args) {\n    $args[&#039;orderby&#039;] = &#039;rand&#039;;\n    return ($args);    \n  }<\/code><\/pre>\n<p>With WC2.6 it worked but I think after updated WC3, this code doesn&#8217;t work.<\/p>\n<p>Is there some change with WC3?<\/p>\n<p>Thank you and best regards<\/p>\n<p>EDIT: or maybe the new products are display before the other even if there is random order?&#8230; Is it possible? (think)<\/p>\n","protected":false},"template":"","class_list":["post-9143168","topic","type-topic","status-publish","hentry","topic-tag-order"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9143168","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9143168\/revisions"}],"predecessor-version":[{"id":9143229,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9143168\/revisions\/9143229"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=9143168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}