Home › Forums › WoodMart support forum › Order By” Element Not Working on Product Archive Layout
Order By” Element Not Working on Product Archive Layout
- This topic has 11 replies, 2 voices, and was last updated 2 weeks, 6 days ago by Luke Nielsen.
-
AuthorPosts
-
September 5, 2024 at 12:59 am #595307
koraybesirliParticipantHello 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 BesirliSeptember 5, 2024 at 9:54 am #595387
Luke NielsenKeymasterHello,
Send me access to the admin dashboard so I can investigate that issue on your side.
Thank you in advance.
Kind Regards
September 5, 2024 at 1:19 pm #595458
koraybesirliParticipantHello 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 BesirliSeptember 6, 2024 at 12:15 pm #595709
Luke NielsenKeymasterHello,
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
September 9, 2024 at 12:34 am #596013
koraybesirliParticipantHello 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.
September 9, 2024 at 11:38 am #596105
Luke NielsenKeymasterHello,
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
- This reply was modified 3 weeks, 3 days ago by Luke Nielsen.
September 9, 2024 at 4:04 pm #596226
koraybesirliParticipantI 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.
- This reply was modified 3 weeks, 3 days ago by koraybesirli.
Attachments:
You must be logged in to view attached files.September 10, 2024 at 4:34 pm #596476
Luke NielsenKeymasterHello,
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
September 10, 2024 at 5:02 pm #596489
koraybesirliParticipantHello,
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
September 11, 2024 at 6:02 pm #596791
Luke NielsenKeymasterHello,
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
September 13, 2024 at 12:37 am #597120
koraybesirliParticipantHi 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 BesirliSeptember 13, 2024 at 12:13 pm #597230
Luke NielsenKeymasterHello,
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
-
AuthorPosts
The topic ‘Order By” Element Not Working on Product Archive Layout’ is closed to new replies.
- You must be logged in to create new topics. Login / Register