I am adding products programatically in WooCommerce and I am trying to add multiple free products to an order. The Free products are selected in the theme settings via an Advanced Custom Fields repeater. This repeater has no limit, so can be several products.
I have managed to to get one product to show (the latest created in the repeater) with a price of 0. How Do I create so if I have more then one product selected the order gets updated with all of these as separate line items? I assume a foreach loop somehow?