{"id":8449,"date":"2021-04-28T23:24:45","date_gmt":"2021-04-28T21:24:45","guid":{"rendered":"https:\/\/www.welaunch.io\/en\/?post_type=faq&#038;p=8449"},"modified":"2021-04-29T17:25:08","modified_gmt":"2021-04-29T15:25:08","slug":"woocommerce-single-variation-sorting-does-not-work","status":"publish","type":"faq","link":"https:\/\/www.welaunch.io\/en\/knowledge-base\/faq\/woocommerce-single-variation-sorting-does-not-work\/","title":{"rendered":"WooCommerce Single Variation Sorting does not work"},"content":{"rendered":"<p>Sometimes you might see sorting or menu order issues with single variations in WooCommerce. We will explain you how this issue was solved in our single variations plugin.<\/p>\n<p>By default WooCommerce is sorting products by a field called &#8220;menu_order&#8221;. An example:<\/p>\n<ul>\n<li>T-Shirt -&gt; 1<\/li>\n<li>Hoodie -&gt; 2<\/li>\n<li>Cap -&gt; 3<\/li>\n<\/ul>\n<p>You can change this default sorting in WooCommerce &gt; Products &gt; Sorting. Here you can drag and drop products to have them in the menu order you like them to.<\/p>\n\t<div class=\"img has-hover x md-x lg-x y md-y lg-y\" id=\"image_546201474\">\n\t\t\t\t\t\t\t\t<div class=\"img-inner box-shadow-1 box-shadow-3-hover dark\" >\n\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"1020\" height=\"432\" src=\"https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/04\/default-woocommerce-sorting-1024x434.png\" class=\"attachment-large size-large\" alt=\"default woocommerce sorting\" srcset=\"https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/04\/default-woocommerce-sorting-1024x434.png 1024w, https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/04\/default-woocommerce-sorting-247x105.png 247w, https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/04\/default-woocommerce-sorting-510x216.png 510w, https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/04\/default-woocommerce-sorting-300x127.png 300w, https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/04\/default-woocommerce-sorting-768x326.png 768w, https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/04\/default-woocommerce-sorting.png 1326w\" sizes=\"auto, (max-width: 1020px) 100vw, 1020px\" \/>\t\t\t\t\t\t\n\t\t\t\t\t\t\t<div class=\"caption\">default woocommerce sorting<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\n<style>\n#image_546201474 {\n  width: 100%;\n}\n<\/style>\n\t<\/div>\n\t\n\t<div id=\"gap-1725012846\" class=\"gap-element clearfix\" style=\"display:block; height:auto;\">\n\t\t\n<style>\n#gap-1725012846 {\n  padding-top: 30px;\n}\n<\/style>\n\t<\/div>\n\t\n<p>Variations however are custom post types with an own menu_order field. So for example:<\/p>\n<ul>\n<li>T-Shirt -&gt; 1\n<ul>\n<li>T-Shirt Blue &gt; 1<\/li>\n<li>T-Shirt Red &gt; 2<\/li>\n<li>T-Shirt Yellow &gt; 3<\/li>\n<\/ul>\n<\/li>\n<li>Hoodie -&gt; 2\n<ul>\n<li>Hoodie Blue &gt; 1<\/li>\n<li>Hoodie Red &gt; 2<\/li>\n<li>Hoodie Yellow &gt; 3<\/li>\n<\/ul>\n<\/li>\n<li>Cap -&gt; 3\n<ul>\n<li>Cap Blue &gt; 1<\/li>\n<li>Cap Red &gt; 2<\/li>\n<li>Cap Yellow &gt; 3<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>You might see the issue now here: In category or listing pages your products are totally messed up, because T-Shirt Blue has the same sorting as Hoodie and Cap Blue:<\/p>\n<ol>\n<li>T-Shirt Blue &gt; 1<\/li>\n<li>Hoodie Blue &gt; 1<\/li>\n<li>Cap Blue &gt; 1<\/li>\n<li>&#8230;<\/li>\n<\/ol>\n<p>To solve this issue we added an option to inherit or override the single variation menu order with the parent variable one.\u00a0<\/p>\n\t<div class=\"img has-hover x md-x lg-x y md-y lg-y\" id=\"image_2062295049\">\n\t\t\t\t\t\t\t\t<div class=\"img-inner box-shadow-1 box-shadow-3-hover dark\" >\n\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"1020\" height=\"343\" src=\"https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/04\/single-variations-inherit-menu-order-1024x344.png\" class=\"attachment-large size-large\" alt=\"single variations inherit menu order\" srcset=\"https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/04\/single-variations-inherit-menu-order-1024x344.png 1024w, https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/04\/single-variations-inherit-menu-order-247x83.png 247w, https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/04\/single-variations-inherit-menu-order-510x172.png 510w, https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/04\/single-variations-inherit-menu-order-300x101.png 300w, https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/04\/single-variations-inherit-menu-order-768x258.png 768w, https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/04\/single-variations-inherit-menu-order-1536x517.png 1536w, https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/04\/single-variations-inherit-menu-order.png 1974w\" sizes=\"auto, (max-width: 1020px) 100vw, 1020px\" \/>\t\t\t\t\t\t\n\t\t\t\t\t\t\t<div class=\"caption\">single variations inherit menu order<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\n<style>\n#image_2062295049 {\n  width: 100%;\n}\n<\/style>\n\t<\/div>\n\t\n\t<div id=\"gap-951907933\" class=\"gap-element clearfix\" style=\"display:block; height:auto;\">\n\t\t\n<style>\n#gap-951907933 {\n  padding-top: 30px;\n}\n<\/style>\n\t<\/div>\n\t\n<p>After activating, the new listing will look like this<\/p>\n<ul>\n<li>T-Shirt -&gt; 1\n<ul>\n<li>T-Shirt Blue &gt; 1<\/li>\n<li>T-Shirt Red &gt; 1<\/li>\n<li>T-Shirt Yellow &gt; 1<\/li>\n<\/ul>\n<\/li>\n<li>Hoodie -&gt; 2\n<ul>\n<li>Hoodie Blue &gt; 2<\/li>\n<li>Hoodie Red &gt; 2<\/li>\n<li>Hoodie Yellow &gt; 2<\/li>\n<\/ul>\n<\/li>\n<li>Cap -&gt; 3\n<ul>\n<li>Cap Blue &gt; 3<\/li>\n<li>Cap Red &gt; 3<\/li>\n<li>Cap Yellow &gt; 3<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>So in your category listings you will first see all T-Shirts, then Hoodies and then Caps. When this was not enabled before do a reset and init again.\u00a0<\/p>\n<p>This solution has one drawback: you can no longer sort variations on single products (for whatever reason you want to do anyway).\u00a0<\/p>\n\t<div class=\"img has-hover x md-x lg-x y md-y lg-y\" id=\"image_1931028829\">\n\t\t\t\t\t\t\t\t<div class=\"img-inner box-shadow-1 box-shadow-3-hover dark\" >\n\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"1020\" height=\"138\" src=\"https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/04\/single-variation-ordering-1024x139.png\" class=\"attachment-large size-large\" alt=\"single variation ordering\" srcset=\"https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/04\/single-variation-ordering-1024x139.png 1024w, https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/04\/single-variation-ordering-247x34.png 247w, https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/04\/single-variation-ordering-510x69.png 510w, https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/04\/single-variation-ordering-300x41.png 300w, https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/04\/single-variation-ordering-768x104.png 768w, https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/04\/single-variation-ordering-1536x209.png 1536w, https:\/\/www.welaunch.io\/en\/wp-content\/uploads\/sites\/8\/2021\/04\/single-variation-ordering-2048x278.png 2048w\" sizes=\"auto, (max-width: 1020px) 100vw, 1020px\" \/>\t\t\t\t\t\t\n\t\t\t\t\t\t\t<div class=\"caption\">single variation ordering<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\n<style>\n#image_1931028829 {\n  width: 100%;\n}\n<\/style>\n\t<\/div>\n\t\n\t<div id=\"gap-938842856\" class=\"gap-element clearfix\" style=\"display:block; height:auto;\">\n\t\t\n<style>\n#gap-938842856 {\n  padding-top: 30px;\n}\n<\/style>\n\t<\/div>\n\t\n<p>If you require to sort single variation on product level and you can live with a mixed listing \/ category sorting just turn the option in our plugin settings off.<\/p>\n","protected":false},"author":1,"featured_media":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","product_cat":[],"class_list":["post-8449","faq","type-faq","status-publish","hentry","faq_topics-show-single-variations","faq_topics-single-variations-faq"],"_links":{"self":[{"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/faq\/8449","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/faq"}],"about":[{"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/types\/faq"}],"author":[{"embeddable":true,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/comments?post=8449"}],"version-history":[{"count":7,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/faq\/8449\/revisions"}],"predecessor-version":[{"id":8468,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/faq\/8449\/revisions\/8468"}],"wp:attachment":[{"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/media?parent=8449"}],"wp:term":[{"taxonomy":"product_cat","embeddable":true,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/product_cat?post=8449"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}