Is there a way to loop trough multiple list items using rules, calculate some value (done trough here) and than that value to be available out of loop?

I need to loop trough content fields of some content type, look for value of that field and multiply it with the value of another field [done]
and then sum the results of each line calculation in some sort of var or something that will be available out of that loop. [no solution for this]

Maybe is a noob question but Im trying for 1 day with this problem. :-(

Comments

SilviuChingaru’s picture

Component: Rules Core » Rules Engine

Also is there a way to add condition something like
commerce-order:commerce-line-items:*:type EQUALS product
instead of

commerce-order:commerce-line-items:0:type EQUALS product
commerce-order:commerce-line-items:1:type EQUALS product
commerce-order:commerce-line-items:2:type EQUALS product
 ...
commerce-order:commerce-line-items:n:type EQUALS product

in order for a custom field to be available for an action loop???

Thank you for any help.

petergus’s picture

Component: Rules Engine » Rules Core

im trying to do do this to, have you figured it out? (saving the loop result into a var)

tr’s picture

Issue summary: View changes
Status: Active » Closed (duplicate)