I created a small module which has a plugin. This plugin must exchange a method with my own.
But my plugin is never being called.
I have been staring at this for a few hours. Can anyone help me with this?
/etc/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">
<type name="Magento\CatalogSearch\Model\Indexer\Fulltext\Action\DataProvider">
<plugin disabled="false"
name="Custom_ConfigurableChildSearch_DataProvider"
sortOrder="10"
type="Custom\ConfigurableChildSearch\Plugin\DataProvider"/>
</type>
</config>
/Plugin/DataProvider.php:
<?php
namespace Custom\ConfigurableChildSearch\Plugin;
class DataProvider
{
/**
* @param \Magento\CatalogSearch\Model\Indexer\Fulltext\Action\DataProvider $subject
* @param \Closure $proceed
*
* @param $indexData
* @param $productData
* @param $storeId
*/
public function aroundPrepareProductIndex(\Magento\CatalogSearch\Model\Indexer\Fulltext\Action\DataProvider $subject, \Closure $proceed, $indexData, $productData, $storeId)
{
var_dump('test');
exit;
}
}