I'm working on a module which is going to be used alongside Drupal Commerce so people can buy a set number of digital products. I've written a custom rules action, which will be run once for each purchase of a specific commerce product. How can I add this to a loop, so that the action gets run n times (n being the quantity purchased for this product, as you could purchase more than one).
So far I've added this action to a loop for
commerce-order:commerce-line-items but even if I purchase more than one, the action is only run once. How can I make the action run 'quantity of this product purchased' number of times?