I create plugin in my custom module to override the method collectCarrierRates($carrierCode, $request)
, below code is not working.
What mistake here?
app/code/Vendor/Shippingtest/etc/frontend/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\Shipping\Model\Shipping">
<plugin name="vendor-shippingtest-test"
type="Vendor\Shippingtest\Plugin\Test"
sortOrder="10"/>
</type>
</config>
app/code/Vendor/Shippingtest/Plugin/Test.php
<?php
namespace Vendor\Shippingtest\Plugin;
class Test
{
public function after(Magento\Shipping\Model\Shipping $subject, $result)
{
echo "Calling";
}
}