
<?php
    $helper = $this->helper('Magetop\Agency\Helper\Data');
    // $_productCollection = $block->getLoadedProductCollection();
    $assignInfo = array();
    foreach ($block->getItems() as $_product) {
        $check = false;
        $productUrl = $_product->getProductUrl();
        if (($_product->getTypeId() == 'simple')||($_product->getTypeId() == 'virtual')) {
            $originalQty = $helper->getOriginalQty($_product->getId());
            
            if ($originalQty == 0) {
                $check = true;
            }
        }
        $assignInfo[$productUrl]['stock'] = $check;
    }
    $data = [
                "assignInfo" => $assignInfo,
                "msg" => __('Availabe from other sellers'),
                "label" => __("view")
            ];
    $data = json_encode($data);
?>
<script type="text/x-magento-init">
{
    "*": {
        "list": <?php echo $data ?>
    }
}
</script>
