This may be chalked up to my not understanding Rules fully, but how can I set field values for a flag from Rules?

My use case is a wedding registry: I set a 'purchased' flag on a product on Checkout, which has already been flagged for 'added to registry' by the Wedding Couple. The problem is that after checkout, I'm not able to specify the quantity that was purchased, which should be a field attached to the flag?

Thanks!

Comments

Status:Active» Postponed

Rules integration with the 7.x-3.x branch is limited (possibly non-existent). The Flag maintainers have requested help with Rules (see #1736524: Rules maintainer / decouple Rules integration to a new project) but nobody has stepped up yet.

You may want to try the 7.x-2.x branch and see if that helps you better?

If I understand you correctly, the process works fine in the 7.x-3.x branch. Here are the steps you need to perform:

1. Set up your flag
2. Go to rules, add a new rule, which, triggers upon checkout.
a. The condition for the rule (this basically allows you to see the field values for that content type when you setup your action):
- Content is of type,
- Parameter: Content: [flagged-node], Content types: Article (your content type in this case)
b. The action for the rule:
- Set a data value
- Parameter: Data: [flagged-node:field-my-field] (the purchase field in your case), Value: [site:current-user:uid] (the quantity no. in your case)

Basically, if you figure out how to use the data selectors, then, understanding the way Flags and Rules work becomes a lot easier. In my opinion, I really don't think Flags integration with Rules is non-existent.

Status:Postponed» Needs review

Status:Needs review» Fixed

Marking as fixed. Since there are no responses for it, I am going to believe it worked.

Actually, I was not able to get it to work.

I had problems with the Content:[flagged-node] part: it doesn't know what node is flagged, if you set the rule to trigger on checkout. The Content would be the Order, right? In this scenario, the flagged product is attached to the line item, if that sounds correct.

Is my logic off, in how to get this to work with rules?

  1. Wedding Couple flags a product with 'Add to Registry' with a quantity field set
  2. Customer browses products flagged with 'Add to registry' for the Couple, and purchases item in the Customer's desired quantity. (So if the Wedding Couple only wants 20 of one item, no single person buys them all)
  3. Rule is setup to verify that the Customer actually bought the product, and in what quantity

Will take a look at this again and hopefully post a solution to it.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Status:Closed (fixed)» Active