Trying to make a cumulative discount for users of the site.The conditions are simple:
if the amount of completed orders is from 1000 to 2000, then the customer’s discount on next order is 3%, if from 2000 to 5000, then 5%, etc.Plus, this should be accumulated and stored at the user level, I think with The goal is clear.

And so the first thing I did was to create a field in which I would record the client’s turnover in the"user field management", after which I would calculate the discount conditionally through the rules.

Next you need to create a"rule" that will count the turnover of the client.

I do:
Event - after updating an existing order.
Condition -"Data Comparison" order status must be wounded"Completed".(Because you do not want to give a discount for incomplete orders)
Action -"Calculate value" commerce-order: total(total order amount) + site: current-user: field-oborot(current user's turnover field)=result
"Set value" customer turnover=result

Bottom line: everything works, BUT turnover considers the one who changes the status of the order, that is, the current user who is in the condition is the admin who changes the status of the order.

Help make the right condition or even consider ready-made solutions in the form of modules.

1 Answers 1

Use commerce-order: owner: field-oborot instead of site: current-user: field-oborot

You may have to add an Entity has field condition so that Rules sees the field_oborot field.
  • Thanks, this way and decided
    I tried it before, apparently where there was an error
    – Misty52 Nov 8 '17 at 11:08