![Check out Enfold](https://kriesi.at/wp-content/themes/kriesi/images/banner-enfold.jpg)
Tagged: enfold, Product, sorting, woocommerce
-
AuthorPosts
-
July 12, 2016 at 12:42 am #659592
I’ve seen similar threads on the subject, but they are all older…so I believe this issue has a new cause. That cause being the new version of WooCommerce. I know it has caused several little issues with Enfold. Just wanted to give notice of another little one. For the product grid, no matter what I set the sorting to it will only display the products in a random order. Even if I set it to allow the customer to sort, the sort bar doesn’t show and it sorts them randomly each time you load the page.
July 12, 2016 at 1:29 pm #659818Hi Kahil,
Could you provide us with a link to the site in question so that we can take a closer look please?
Best regards,
RikardJuly 12, 2016 at 5:22 pm #659987At first I thought it was the custom code you guys gave in another thread to add “random” as a sorting option….so I removed it to make sure and it still happened. No matter what I do, I can only get it to randomly display products. Then I noticed that there were new options for product sorting in woocommerce itself. So I’m guessing it just amounts to a conflict there.
July 15, 2016 at 3:13 am #661101Hi,
We checked the “Store” page and other category pages but the sorting options are not there. Did you disable it? Please enable it back so that we can inspect the issue.
Best regards,
IsmaelJuly 20, 2016 at 7:56 pm #663099Sorry for the late reply…
I don’t use the Woocommerce store page….it just slaps everything into one page and I prefer to separate them out by type/category, etc.
On each page I am using the product grid that is part of Enfold. I have in Woocommerce the default sorting to be by name. Regardless of the option I set in the product grid section, the products are displayed in random order. Here is a link to one of the pages and I have set it to display the sorting drop downs. Still…nothing I select puts them in any order but random.
July 24, 2016 at 5:01 pm #664412Hi,
We created a page with the product grid, sorting option enabled, on our installation and the items are sortable. Please post the login details here so that we can check the settings.
Best regards,
IsmaelJuly 25, 2016 at 8:15 pm #664806Info included in the private content for you.
The only definite, common link I have found with this issue was that it only started after the last major WooCommerce update. So I chalked it up to being just an issue related to that and lil incompatibilities with the theme that your dev team is working on.
I also don’t know if it is related, but there is an official plugin from WooCommerce I have (Measurement Price Calculator) that causes an issue when activated. It won’t let me add to the cart. Gives a common javascript error that isn’t specific about Qty, etc. So perhaps there is some sort of javascript issue somewhere that is the link to all these issues. I haven’t been able to track it down. I just know that it all didn’t happen until WooCommerce was updated. :/
July 27, 2016 at 4:42 pm #665804Hi,
you are using lots of plugins.Please deactivate all plugins but WooCommerce by WooThemes one by one to check which one is causing this issue and let us know if this solves the problem.
In addition to that, please let us know if we are allowed to deactivate one or more of your plugins as well for testing purposes :)Best regards,
AndyJuly 27, 2016 at 8:33 pm #665928Yeah….that’s the nature of using WooCommerce though right? lol… Rather than creating a robust main plugin, you have to install all kinds of supplemental plugins just to get small features. It’d be a LOT worse if I wasn’t using ACF Pro and a some hooks via functions.php. I’ll give the deactivate/activate thing ago….was just hoping to avoid doing so. :)
I have most of the official WooCommerce plugins gathered over the years….several aren’t even installed. If you would prefer, I could setup a test site for you with them all activated so you guys can test away if that helps to make Enfold that much better.
July 27, 2016 at 8:44 pm #665933That didn’t work…no matter what it always displayed them randomly. In all honesty, it isn’t really that big of a deal…more of an annoyance. I can’t seem to figure out the cause. :/
July 28, 2016 at 12:48 pm #666161Hi,
again: are we allowed to deactivate all your plugins for testing purposes?
Best regards,
AndyJuly 28, 2016 at 6:12 pm #666366Sure. Just please reactivate when done.
August 2, 2016 at 3:47 am #667524Hi,
We found this code in the functions.php file. It overrides the sorting query:
// adds an extra option for sorting product listings randomly add_filter( 'woocommerce_get_catalog_ordering_args', 'custom_woocommerce_get_catalog_ordering_args' ); function custom_woocommerce_get_catalog_ordering_args( $args ) { $orderby_value = isset( $_GET['orderby'] ) ? woocommerce_clean( $_GET['orderby'] ) : apply_filters( 'woocommerce_default_catalog_orderby', get_option( 'woocommerce_default_catalog_orderby' ) ); if ( 'random_list' == $orderby_value ) { $args['orderby'] = 'rand'; $args['order'] = ''; $args['meta_key'] = ''; } return $args; } add_filter( 'woocommerce_default_catalog_orderby_options', 'custom_woocommerce_catalog_orderby' ); add_filter( 'woocommerce_catalog_orderby', 'custom_woocommerce_catalog_orderby' ); function custom_woocommerce_catalog_orderby( $sortby ) { $sortby['random_list'] = 'Random'; return $sortby; }
Best regards,
IsmaelAugust 2, 2016 at 3:50 am #667525Lol… I know. I got it from you guys in another thread. Is supposed to only add it as an option. Been working for a while until this past big update of woocommerce. I’ll try hiding it again, but I tried that before and it didn’t resolve the problem. Will give it another go.
August 3, 2016 at 1:41 am #667887That part was removed entirely and no matter what option I choose from the Enfold drop down, it displays them randomly every time.
August 6, 2016 at 5:57 am #669215Hi,
We also disabled this function:
//add_filter('avia_product_slide_query', 'avia_product_slide_query_mod', 10, 2); function avia_product_slide_query_mod($params) { $params['orderby'] = 'rand'; return $params; }
You can apply this filter in a specific page. Use the is_page conditional function.
Best regards,
IsmaelAugust 7, 2016 at 10:25 pm #669533Thank you. Didn’t think that would have caused the issue since I wasn’t using the slider. May want to have someone do a search in this forum for those code block and give everyone a heads up that they no longer work as intended….or figure out how to make it work with the newer versions of WooCommerce. :)
August 11, 2016 at 4:34 pm #671423Hi,
glad we could help. Let us know in a new ticket if you have some more questions related to the theme. We are happy to assist you.
Best regards,
Andy -
AuthorPosts
- The topic ‘WooCommerce product sorting…’ is closed to new replies.