You will have to overwrite the constructor of the parent class and add your extra class instance on to it something like:
<?php
namespace Vendor\Module_Name\Block\Product;
use Magento\Catalog\Block\Product\Context;
use Magento\Framework\Data\Helper\PostHelper;
use Magento\Catalog\Model\Layer\Resolver;
use Magento\Framework\Url\Helper\Data as UrlHelper;
use Vendor\Mymodule\Helper\Data as Helper;
use Magento\Catalog\Block\Product\ListProduct as MagentoListProduct
class ListProduct extends MagentoListProduct
{
/**
* @param Context $context
* @param \Magento\Framework\Data\Helper\PostHelper $postDataHelper
* @param \Magento\Catalog\Model\Layer\Resolver $layerResolver
* @param CategoryRepositoryInterface $categoryRepository
* @param \Magento\Framework\Url\Helper\Data $urlHelper
* @param array $data
*/
public function __construct(
Helper $customHelper
Context $context,
PostHelper $postDataHelper,
Resolver $layerResolver,
CategoryRepositoryInterface $categoryRepository,
UrlHelper $urlHelper,
array $data = []
) {
$this->customHelper = $customHelper;
parent::__construct(
$context,
$postDataHelper,
$layerResolver,
$categoryRepository,
$urlHelper,
$data
);
}
public function test()
{
$this->customHelper->yourCustomMethod();
}
}
But if its only the helper you would like to use in the PHTML file you need not overwrite the ListProduct block you can use the following method as well.
First you can overwrite the template file using an custom theme.
In the new file you can get a instance of you helper using:
$customHelper = $this->helper('Vendor\Mymodule\Helper\Data');
And ofcourse you would need to clear the var folder either by
rm -rf ./var/*
or you can do it by
php bin/magento cache:clean
php bin/magento cache:flush
Hope this helps