frontend/di.xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Quote\Model\ShippingMethodManagement"> <plugin name="vnsShippingmethodmanagement" type="VNS\Shippingquote\Model\ShippingMethodManagement" sortOrder="1"/> </type>
Model/ShippingMethodManagement.php
public function __construct( \Magento\Catalog\Api\ProductRepositoryInterface $productRepository) { $this->productRepository = $productRepository; } private function afterGetShippingMethods(Quote $quote, $output) { error_log('test'); }
Module is installed/enabled, cache cleared, genereated/ deleted.