Rules - Looping Line Item Quantity
I have a product type "Gift Pack" which has three types available– small, medium and large, respectively £50, £60 and £70. The idea is when a gift pack is purchased a Coupon is created with the corresponding value for each of the purchased gifts.
So far (with rules) I am able to create a new coupon for each of the packs but there is an issue in that I can only loop over the line items and not the quantity of line items. So if a customer buys 3 small gifts and 2 large gifts my rule only generates 1 small coupon and one large coupon as the line items are bundled together in the loop.
Similarly, on another product type, upon checkout I need to generate 3 nodes for each product purchased. Again my rule can not loop through multiple quantities of the same line item.
I've read a few other posts which get into custom module development and areas of PHP which are a little over my head at the moment. I get Rules but don't know if the above can be achieved with a standard Rules approach.
There could be a bounty available here if anyone is up for the challenge.