let callbackModal = $('#callback_modal div[role=form] .screen-reader-response');
if (callbackModal.length){
callbackModal.append('<span role="status"></span>');
} else {
$('#callback_modal div[role=form]').append('<div class="screen-reader-response"><span role="status"></span></div>');
}
global $product;
$related_product_ids = array_merge($product->get_upsell_ids() ?: [], $product->get_cross_sell_ids() ?: []);
foreach ($related_product_ids as $related_product_id){
$related_product = get_post($related_product_id);
// ...
}