• Resolved Sarun developer

    (@saruncloudspring)


    On my website i updated the woocommerce form 3.2.6 into 3.3.3 After the updation my search result page showing product result is not sorting as price low to high.I just rolled back my woocommerce into 3.2.6 at that time search result page showing products are in low to high.How i solve this problem in woocommerce 3.3.3 version.
    You replicate this issue by click this link https://orderprintercartridges.com/?s=tn336&post_type=product

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    The ordering of products depends on this field: https://cld.wthms.co/mYyLsu

    It is set up and the default is configured at Appearance > Customize > WooCommerce > Product Catalog in WC 3.3+

    Thread Starter Sarun developer

    (@saruncloudspring)

    But in woocommerce 3.2.6 its working perfectly i dont want to select that drop down by default it showing product search result as low to high. But in woocommerce 3.3.3 version default search result showing as random. Even i selected sort by price (asc) in Appearance > Customize > WooCommerce > Product Catalog section in woo 3.3.3 the search result page showing result sorted by random. please see attached screen shot https://www.screencast.com/t/bnbSnS6Joq1c

    Thread Starter Sarun developer

    (@saruncloudspring)

    And also iam taking about the search result page not the shop

    Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    Ah right, so search results start with the “relevance” orderby by default. Since the user is searching for a specific term, this makes sense. You can see this happening here: https://github.com/woocommerce/woocommerce/blob/5bea7de93c152f15207750c3dd7e1a5ab6b6a0f8/includes/class-wc-query.php#L436-L438

    You can change this behavior with some custom code using the woocommerce_get_catalog_ordering_args filter.

    Thread Starter Sarun developer

    (@saruncloudspring)

    How i change the orderby “relevance” into price low to high on search page? If there any hook or function available for that?

    Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    woocommerce_get_catalog_ordering_args is the hook you can use to change this. It passed in args, and you will want to change these two if in a search query:

    
    $args['orderby'] = 'relevance';
    $args['order']   = 'DESC';
    
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘After woocommerce updating search result not showing as price low to high.’ is closed to new replies.