Viewing 4 replies - 1 through 4 (of 4 total)
  • What does “Availability” mean to you in this context? Not quite clear on what data you want to sort on.

    Thread Starter Tib781

    (@tib781)

    I have some product on stock and some another not in stock in each moment.
    So I mean with”sort by availability” that my customer can choose to see only the products/item in stock in the moment that he look my shop.

    The “sort by availability” is in the list of all the sorts , but he don’t do the sort, I mean that all the items showing up not only who’s in stock like I want to see.

    Hope you understand and can help me
    thanks
    thib

    See here:

    http://docs.woothemes.com/document/custom-sorting-options-ascdesc/

    What you want to do is use that code and add something like this to “case” clauses in the custom_woocommerce_get_catalog_ordering_args function:

    case 'availability_asc' :
    	$args['orderby'] = 'meta_value_num';
    	$args['order'] = 'asc';
    	$args['meta_key'] = '_stock';
    break;

    And something like this to the custom_woocommerce_catalog_orderby function:

    $sortby['availability_asc'] = 'By availability';

    Or maybe change “asc” to “desc” in all instances. “asc” means ascending ( low to high ) , “desc” means decending ( high to low ).

    Thread Starter Tib781

    (@tib781)

    I already try this solution but it doesn’t work.
    The “sort by availability” is in the list of all the sorts , but he don’t do the sort.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Sort by availability’ is closed to new replies.