'context' =>
$context,
] ) );
$body = '';
while ($productResult =
$iterator->
fetch()) { foreach ($productResult->
getEntities() as $product) { $data =
$productContext->
getContext();
$data['product'
] =
$product;
if ($productExport->
isIncludeVariants() && !
$product->
getParentId() &&
$product->
getChildCount() > 0
) { continue; // Skip main product if variants are included
} if (!
$productExport->
isIncludeVariants() &&
$product->
getParentId()) { continue; // Skip variants unless they are included
} $body .=
$this->productExportRender->
renderBody($productExport,
$context,
$data);
} if ($exportBehavior->
batchMode()) { break;
}