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 can create a rule with: Add Event "After saving new comment" or "after udating an existing comment" Add action to the rule, under the "Organic Groups" section, there is a "Get group managers from group audience". Then you add a loop for this list, and then use the "Send email" from under "System" section.


2

Make a custom module called 'email_lowercase' and place this code inside it, before runnin this new action, do on both emails 'convert a data type' to 'text', then run the new action this custom module provides with Example@example.com TEXT-token-value you have just converted. After running custom action it will return a TEXT in lowercase, then comapre your ...


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


2

Install views rules module, make a views-rule of users, if you need UID as a contextual filer add it as always, then in middle column set your UID as an integer in parameters settings, add user pictures as a field, now in middle column settings, set user-pictures as an file entity. then in your rule, fetch entity by id with your variable UID, now you have ...


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

Piece of cake: add a Rules Condition like "Entity has field" (for your overallStatus field), which will make that field available for testing in subsequent Rules Conditions and/or Rules Actions. add a Rules Condition (after the previous one, important!) to verify if the unchanged value of your overallStatus field is yes or no equal to the value of your ...


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

A possible solution is to transform the rule you already have, into a Rules Component, so that your original Rule "schedules the execution" (using the Rules Scheduler submodule) of that Rules Component (eg X secs or mins "after saving the content") ... That Rules Component will then be executed next time cron runs. If you then also add an extra Rules Action ...


1

When product sell prices are calculated via Rules, they are done so in the context of either a temporary line item (for products not in the cart) or the line item on an order (for products in the cart). This means you can check to see if the commerce-line-item:line-item-id is empty or not using something like the "Data value is empty" condition. In your case,...


1

Nodes already have a 'changed' property that would track this. Any reason why you don't want to use that? You can use {{ node.getChangedTime() }} in a Twig template for the raw value, or you can preprocess the node and take the changed value and format the date to your need into a new variable for the template. This way you don't need another field and Rules ...


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