How do you Create Coupon with rules?

Comments

joco_sp’s picture

In Rules under Actions I selected Entities -> Create a New Entity -> Commerce Coupon (in the next step no other field shows up).

When I use this action on an Event -> User has logged in, the coupon is not added. If I try to select any other entity, then is normally added at log in.
Do I need to make a custom Rule for making a New Commerce Coupon or am I doing something wrong?

joco_sp’s picture

Here is a little help.

Actions

1. Add Action - Entites - Create a new entity
- select Commercce Coupon - Continue - Save

2. Add Action - Data - Set a data value - select the field you want (ex. entity-ecreated:commerce-coupon-number-of-uses)
- enter the value you want - Save

3. Do the 2. for the fields you want

At the end I decided to do my custom Rule action for creating a coupon, because is more flexible.