Home Forums WoodMart support forum ajax search result need to sort by InStock

ajax search result need to sort by InStock

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #252335

    bidopinco
    Participant

    hey
    i need to sort ajax search result by In Stock First.
    how should i do this

    #252346

    Hello,

    Sorry, but there is no option in Theme Settings to sort the ajax search results.

    It requires customizations and this is beyond our limitations and support policy.

    Regards.
    Xtemos Studios.

    #252461

    bidopinco
    Participant

    witch filter should i use to access ajax search suggests ?

    #252660

    Hello,

    Sorry, I did not understand your question.

    Best Regards.

    #253072

    bidopinco
    Participant

    I need to re Order Ajax search suggested result but I need to know witch Filter should i Use to access that results.

    #253092

    Hello,

    You can find the file under “woodmart/inc/modules/search.php”

    You can customize it at your own risk.

    Regards.
    Xtemos Studios.

    #253737

    bidopinco
    Participant

    I try to handle with this but it’s not work would you please correct me?

    add_filter(‘woodmart_ajax_search_args’, ‘custom_ajax_result_orderby_stock’,20);
    function custom_ajax_result_orderby_stock($query_args) {
    $query_args[‘orderby’] = ‘_stock_status’;
    $query_args[‘order’] = ‘ASC’;

    return $query_args;
    }

    #253880

    Hello,

    Please try these parameters:

      $args['orderby'] = 'meta_value';
       $args['order'] = 'ASC';
       $args['meta_key'] = '_stock_status';
    

    Best Regard

    #254018

    bidopinco
    Participant

    Nice done, that’s work great
    I suggest you to add this option to the next version of Woodmart.

    #254024

    Artem Temos
    Keymaster

    Great, you are welcome!

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

The topic ‘ajax search result need to sort by InStock’ is closed to new replies.