Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
integrate comment from OPer and improve title
Source Link
Pierre.Vriens
  • 36k
  • 40
  • 50
  • 182

How to check in a Rules ubercartCondition 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 Modulemodule.

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).

OPERATIONS (Rule Event): After updating existing content of type Product

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 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->display->display_options['fields']['stock']['id'] = 'stock';
$handler->display->display_options['fields']['stock']['table'] = 'uc_product_stock';
$handler->display->display_options['fields']['stock']['field'] = 'stock';

I use Ubercart 7.x-3.10 (with Stock 7.x-3.10), drupalDrupal 7, Rules 7.x-2.10

Rules ubercart 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.

OPERATIONS (Rule Event): After updating existing content of type Product

{ "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? 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->display->display_options['fields']['stock']['id'] = 'stock';
$handler->display->display_options['fields']['stock']['table'] = 'uc_product_stock';
$handler->display->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

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->display->display_options['fields']['stock']['id'] = 'stock';
$handler->display->display_options['fields']['stock']['table'] = 'uc_product_stock';
$handler->display->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

added 308 characters in body
Source Link

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.

OPERATIONS (Rule Event): After updating existing content of type Product

{ "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? 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->display->display_options['fields']['stock']['id'] = 'stock';
$handler->display->display_options['fields']['stock']['table'] = 'uc_product_stock';
$handler->display->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

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.

OPERATIONS: After updating existing content of type Product

But the stock isn't a field of the node.. How can I select that field? 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->display->display_options['fields']['stock']['id'] = 'stock';
$handler->display->display_options['fields']['stock']['table'] = 'uc_product_stock';
$handler->display->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

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.

OPERATIONS (Rule Event): After updating existing content of type Product

{ "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? 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->display->display_options['fields']['stock']['id'] = 'stock';
$handler->display->display_options['fields']['stock']['table'] = 'uc_product_stock';
$handler->display->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

Source Link

Rules ubercart 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.

OPERATIONS: After updating existing content of type Product

But the stock isn't a field of the node.. How can I select that field? 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->display->display_options['fields']['stock']['id'] = 'stock';
$handler->display->display_options['fields']['stock']['table'] = 'uc_product_stock';
$handler->display->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