I\'m trying to indicate multiple related products on a product page using schema.org microdata. But the child products are orphaned because they are not contained in the par
You don’t use itemref correctly.
You’d have to specify itemref
on the main product instead of the related products:
<div itemref="product-1 product-2" itemscope itemtype="http://schema.org/Product">
<span itemprop="name">Product</span>
</div>
<div id="product-1" itemprop="isRelatedTo" itemscope itemtype="http://schema.org/Product">
<span itemprop="name">Product 1</span>
</div>
<div id="product-2" itemprop="isRelatedTo" itemscope itemtype="http://schema.org/Product">
<span itemprop="name">Product 2</span>
</div>