How to check in a Rules Condition if an Ubercart product is out of order? There isn't a good support for "out of order" in Ubercart for Drupal. I'm trying to fix that with the Rules module.

I'm trying to add a rule that disables the product after the stock is updated, using Rules event After updating existing content of type Product.
I want to disable the product that is sold out (stock = 0).

Here is an export of the rule I have so far:

{ "rules_product_sold_out_check" : {
    "LABEL" : "Product sold out check",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules" ],
    "ON" : { "node_update--product" : { "bundle" : "product" } },
    "DO" : []
  }
}


But the stock isn't a field of the node. How can I select that field within a Rules Condition? I have no idea how to use that in the Rules module as a data selector.


  The data to be compared, specified by using a data selector, e.g.
  "node:author:name".


I'm using the stock also in a view. This is what I use there (export-code-view to show the fieldnames / structure).

$handler-&gt;display-&gt;display_options['fields']['stock']['id'] = 'stock';
$handler-&gt;display-&gt;display_options['fields']['stock']['table'] = 'uc_product_stock';
$handler-&gt;display-&gt;display_options['fields']['stock']['field'] = 'stock';


I use Ubercart 7.x-3.10 (with Stock 7.x-3.10), Drupal 7, Rules 7.x-2.10
As per the UC issue about "Stock transaction should be more flexible through Rules" (from 6 years ago, status "needs work" ...), it seems that at this time trying to use the Rules module for such "out of order" situations may not be a good idea.

You may want to try to use the Ubercart Out of stock Notification module instead. Some details about it (from its project page):


  Out of stock notification for
  Ubercart.
  
  It uses ajax and jquery and asks the server for available stock and
  replaces the 'Add to cart' button with some configurable HTML.
  
  ...
  
  It also provides server-side validation so this module can prevent the
  addition of out of stock items even if JS is disabled or if the user
  clicks on an "Add to cart" button too quickly.