protected $product;
public function setProduct($_product){
$this->product = $_product;
}
public function getProduct(){
return $this->product;
}
<?php /* Start Custom Changes */ ?>
<?php if ($myBlock = $block->getChildBlock('my_child_block')): ?>
<?php
$myBlock->setProduct($_product);
echo $block->getChildHtml('my_child_block', false);
?>
<?php endif; ?>
<?php /* End Custom Changes */ ?>
<?php echo $block->getProduct()->getId(); ?>