I wrote a plugin to Customer.php, for testing purpose, I added the error_log statement, but it had not been executed when I do the login action. Customer.php in my plugin:
<?php
namespace Vendor\PluginTest\Model\Plugin;
class Customer
{
public function afterValidatePassword(\Magento\Customer\Model\Customer $subject,$result)
{
error_log('afterValidatePassword');
return $result;
}
}
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\Customer\Model\Customer">
<plugin name="customer-test-module" type="Vendor\PluginTest\Model\Plugin\Customer" sortOrder="1"/>
</type>
</config>
I can't figure out where's wrong. Anyone can help? Anything I forgot to set? Thanks