Home Forums WoodMart support forum Order By” Element Not Working on Product Archive Layout

Order By” Element Not Working on Product Archive Layout

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #595307

    koraybesirli
    Participant

    Hello WoodMart Support Team,

    I hope you’re doing well. I’m experiencing an issue with the “Order By” (Sort by) element in the Product Archive Layout of my WoodMart theme.

    Issue:
    The “Order By” element functions correctly on the WooCommerce shop page URL (e.g., site.com/woocommerce-shop-page), but it does not work on the Product Archive Layout page URL (e.g., site.com/product-archive).

    The Product Archive Layout should behave the same as the WooCommerce shop page, but the “Order By” functionality is not working when used on this layout’s URL, even though it works as expected on the default WooCommerce shop page URL.

    Question:
    Is there something specific I need to configure to make the “Order By” element work on the Product Archive Layout URL? Since the layout is supposed to act as the same shop page, I would expect the “Order By” element to function on both URLs.

    Thank you for your assistance, and I appreciate any guidance you can provide to resolve this.

    Best regards,
    Koray Besirli

    #595387

    Luke Nielsen
    Keymaster

    Hello,

    Send me access to the admin dashboard so I can investigate that issue on your side.

    Thank you in advance.

    Kind Regards

    #595458

    koraybesirli
    Participant

    Hello WoodMart Support Team,

    Thank you for your assistance so far. I’ve provided the login credentials as requested.

    I would like to clarify the issue further. The “Order By” (Sort by) element works perfectly on the default WooCommerce shop page, which can be accessed at the following link:

    WooCommerce default shop page: https://uzmaneczanem.com/magaza/

    However, when performing a search (e.g., searching for “krem”) and navigating to the search results page, which is based on the Product Archive Layout, the “Order By” element does not function. The sorting options appear but do not work on this search results page.

    I kindly request you to try searching for “krem” on the site and test the “Order By” element on the search results page. You’ll notice that while it works on the default WooCommerce shop page, it does not function on the search results page that uses the Product Archive Layout.

    I would appreciate any insights or solutions you can provide to resolve this issue.

    Best regards,
    Koray Besirli

    #595709

    Luke Nielsen
    Keymaster

    Hello,

    You have protection when logging – https://monosnap.com/file/zi9WBUAjQdKBCkATeafB7QiKVru1EP may you disable it for a while?

    I look forward to hearing back from you.

    Kind Regards

    #596013

    koraybesirli
    Participant

    Hello Luke,

    I have disabled the protection feature as you requested. You should now be able to access it.

    I look forward to hearing back from you.

    Best regards.

    #596105

    Luke Nielsen
    Keymaster

    Hello,

    I see that on the default Storefront theme, it works in the same way, here is a video – https://monosnap.com/file/DXVvDJz8SVfb7Es4JXebFaCSoTzRnB

    So please send me a video from your side showing how it worked well on the default theme.

    Thank you in advance.

    Kind Regards

    #596226

    koraybesirli
    Participant

    I have sent a video showing that when I search for “gunes kremi” and try to change the filter in the search results, the product sorting does not change. When I select “Sort by price: low to high” or “Sort by price: high to low,” the product order remains the same. However, on the WooCommerce default shop page (https://uzmaneczanem.com/magaza), the sorting works correctly.

    Please let me know if you need any further information.

    Best regards.

    Attachments:
    You must be logged in to view attached files.
    #596476

    Luke Nielsen
    Keymaster

    Hello,

    Please, confirm the permission for plugins deactivation As soon as we complete the testing we will enable it all back.

    Thank you in advance.

    Kind Regards

    #596489

    koraybesirli
    Participant

    Hello,

    I give permission to deactivate the plugins. You can re-enable them after completing your testing. I would appreciate it if you could inform me once the process is finished.

    Best regards

    #596791

    Luke Nielsen
    Keymaster

    Hello,

    I have checked it on the default Storefront theme and there is the same issue, here is a video – https://take.ms/3qETt

    It means that the issue is related to WooCommerce so I suggest you contact their support team for further solutions.

    Kind Regards

    #597120

    koraybesirli
    Participant

    Hi Luke,

    I wanted to inform you about an issue I encountered regarding the product sorting on my WooCommerce search results page. After some investigation, I found that the problem was caused by the Relevanssi plugin. It seems Relevanssi does not handle WooCommerce sorting by price, popularity, or rating properly, which caused the sorting function to break.

    I was able to resolve the issue by adding the following code to my functions.php file, which allows Relevanssi to handle WooCommerce’s product sorting correctly:

    add_filter( ‘relevanssi_orderby’, ‘woocommerce_relevanssi_orderby’ );
    function woocommerce_relevanssi_orderby( $orderby ) {
    if ( in_array( $orderby, array( ‘price’, ‘price-desc’ ), true ) ) {
    global $wp_query;
    $orderby = ‘meta_value_num’;
    $wp_query->query_vars[‘meta_key’] = ‘_price’;
    }
    if ( ‘price’ === $orderby ) {
    global $rlv_wc_order;
    $rlv_wc_order = ‘asc’;
    }
    if ( ‘date ID’ === $orderby ) {
    $orderby = ‘post_date’;
    }
    if ( ‘popularity’ === $orderby ) {
    global $wp_query, $rlv_wc_order;
    $orderby = ‘meta_value_num’;
    $rlv_wc_order = ‘desc’;
    $wp_query->query_vars[‘meta_key’] = ‘total_sales’;
    }
    return $orderby;
    }

    add_filter( ‘relevanssi_order’, ‘woocommerce_relevanssi_order’ );
    function woocommerce_relevanssi_order( $order ) {
    global $rlv_wc_order;
    if ( $rlv_wc_order ) {
    $order = $rlv_wc_order;
    }
    return $order;
    }

    After adding this code, the sorting functionality on the search results page started working as expected. I wanted to share this with you in case other users encounter a similar issue.

    Best regards,
    Koray Besirli

    #597230

    Luke Nielsen
    Keymaster

    Hello,

    Great! Glad that you found a solution.

    I hope you are not facing the same issue again in the future.

    Have a good day!

    Kind Regards

Viewing 12 posts - 1 through 12 (of 12 total)

The topic ‘Order By” Element Not Working on Product Archive Layout’ is closed to new replies.