Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
ARray CreditAttribution: ARray commentedThe 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
Comment #2
univate CreditAttribution: univate commentedThere is a stock level field that now solves this.