Hot answers tagged

3

If the data about a product are not available when processing a "line item", you can make them available. To do so, use a technique similar to what is explained in my answer to "How to access commerce_product field of line-items using Rules to flag the Commerce Product?", which includes a Rules Component that looks like so: { "...


2

You need to give the "Administer comments and comment settings" permission to the role and then it will be able to approve the comment.


2

The rule needs to overwrite existing scheduled actions if a new comment is posted on the same node. Yes, you can do this! And you don't have to delete any scheduled tasks. The key here is to use the scheduler action's identifier parameter correctly. There can only be one scheduled component per identifier, so if your identifiers are all the same (for ...


2

To my knowledge, there is nothing in Rules to "overwrite existing scheduled actions" (as in your question). However, by every time attempting to perform an appropriate delete of an already scheduled rule, prior to scheduling a new rule, you achieve a similar result. And such attempt just gets ignored if there was no scheduled rule yet. Read on for more ...


1

you will need flag module make a global user flag: user_has_content, make a rule: react on event: after saving new content of your special type, add a condition: user author is NOT flagged, inside rules action: flag it, only once your user author will be flagged, then on your view, add relationship to author & one more relationship on the new flag on ...


1

You should be able to get this to work, using the Rules module, using the "Drupal is initializing" event. That will ensure that the rule gets triggered BEFORE the actual content is shown. Using Rules event " Content is viewed " is typically 'too late'. Refer to 'How to specify a Rules event like "Content is 'going to be' viewed"?' for more ...


1

Make a flag on users: 'flag_user_has_logged_out', you will need more than one rule, first rule: react on: user has logged out, and flag the user with this new flag, on another rule: react on logged_in: first validate your roles, then validate if user is 'flagged' if so, redirect to /whatever, and unflag user has logged out. if not, the other redirect will ...


1

I'm assuming this needs to happen behind the scenes rather than as a result of user interaction. I suggest you write a custom rules action which runs on cron every 5 minutes (or whatever time period you are happy with). The rule should load all of the relevant nodes using a db_select query, loop through them, check the end date and update the status ...


1

This is very easy to do in D8 Rules. Here is an export of a Rule which does what you asked - when a new user is created, it creates a new node (of type article, as an example). It then sets the node author to be the new user. It then sets a field of the new node (the body field, in this case) to a value take from the user (the user's email address, in this ...


1

D7, install Conditional rules module, this module let's you add aditional conditions at action section in rules UI. You say your event is 'checkout proccess', so, the first thing you need is to load your 'pizza' node object in to rules, I am assuming that you have a field in your product-fields referencing to your 'pizza-content-type'. To do this, in ...


1

First, use the -dev version of Rules. Second, always use the "Show a message on the site" action for testing. This is a LOT easier to debug than "Send email". You can use tokens in the message to test that the values are what you expect them to be, then when you get the right values you can use the email action with those same tokens in your email. Third, ...


1

It will help if you add the rule that you have added. Also if you think it's a complex rule to be applied, you can apply the discount in the checkout page rather than before that without using the rules itself. In other places just display the 1pcs price with the discount applied.


1

If field_software_product_sku is text field you should test on value of the field something like: if ($node->field_software_product_sku[LANGUAGE_NONE][0]['value'] === "Some Product Name"){ echo "<a href=\"http://www.mywebsite.com/Some Product Name/some.exe\">Trial Version Download Link</a><br />"; } other ways if it doesn't work, ...


1

There's a working example in the Rules issue queue that was posted in November 2016, so this has been possible at least since then. See https://www.drupal.org/project/rules/issues/2828422 Here's a slightly modified version of that answer. You may import this into your site and look at it in the UI to learn how to configure this functionality. langcode: en ...


Only top voted, non community-wiki answers of a minimum length are eligible