I need to display "in stock" products before "out of stock" products.
There is no such field available for views.

Is there any way to do that?

Comments

ARray’s picture

The problem is product qty is dynamic value calculating like this:
[code]
$stocklevel = uc_stock_level($node->model);
[/code]
but there are no fields like $node->is_in_stock, $node->stock_level
but it will be very useful to use them in views.

I've tried to solve it using CCK dynamic_field (it computes its value in runtime).
But views uses sql query to database, so dynamic fields can be used to sort data:
http://drupal.org/node/424538

univate’s picture

Status: Active » Fixed

There is a stock level field that now solves this.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.