I am trying to override Block \Magento\Directory\Block\Data
with following method getCountryHtmlSelect()
with following script, but it's not executing.
di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Directory\Block\Data" type="Magenticians\Modulecontact\Block\Data" />
</config>
<?php
namespace Magenticians\Modulecontact\Block;
use Magento\Framework\View\Element\Template;
class Data extends \Magento\Directory\Block\Data
{
public function getCountryHtmlSelect($defValue = null, $name = 'country_id', $id = 'country', $title = 'Country')
{
exit;
}
public function test()
{
exit;
}
?>