Ahh I see the problem now. Instead of having multiple Relationships within one Repeater field, you created a repeater that has a
– Relationship field to one product
– A file
– Another file
Therefore we get the $ids for each Repeater field which will only return one as we only have one Relationship at the time.
What the code tries to do is to order the $ids within each repeater, but there is only one. I’ll look at a different solution later today.