{ "rules_disable_products" : { "LABEL" : "Отключаем купленные товары", "PLUGIN" : "reaction rule", "OWNER" : "rules", "REQUIRES" : [ "commerce_order", "rules", "commerce_checkout" ], "ON" : { "commerce_checkout_complete" : [ ] }, "IF" : [ { "commerce_order_contains_product_type" : { "commerce_order" : [ "commerce_order" ], "product_type" : { "value" : { "product" : "product" } }, "operator" : "\u003E=", "value" : "1" } } ], "DO" : [ { "LOOP" : { "USING" : { "list" : [ "commerce-order:commerce-line-items" ] }, "ITEM" : { "list_item" : "Текущий элемент списка" }, "DO" : [ { "component_rules_cur_line_item" : { "li" : [ "list-item" ] } } ] } } ] } }
{ "rules_cur_line_item" : { "LABEL" : "cur line item", "PLUGIN" : "rule", "OWNER" : "rules", "REQUIRES" : [ "rules" ], "USES VARIABLES" : { "li" : { "label" : "cur line item", "type" : "commerce_line_item" } }, "IF" : [ { "entity_has_field" : { "entity" : [ "li" ], "field" : "commerce_product" } }, { "data_is" : { "data" : [ "li:commerce-product:type" ], "value" : "product" } } ], "DO" : [ { "data_set" : { "data" : [ "li:commerce-product:status" ], "value" : 1 } }, { "entity_fetch" : { "USING" : { "type" : "commerce_product", "id" : [ "li:commerce-product:product-id" ] }, "PROVIDE" : { "entity_fetched" : { "product_fetched" : "продукт" } } } }, { "data_set" : { "data" : [ "product-fetched:status" ], "value" : 0 } }, { "entity_save" : { "data" : [ "product-fetched" ] } } ] } }
category:
Разработка