I'm extending \Magento\Catalog\Pricing\Price\TierPrice to return a custom list of tier prices for products. But I can't seem to figure out how to get the product id that is calling the getTierPriceList method. Any suggestions?
My di.xml:
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Catalog\Pricing\Price\TierPrice" type="MyCompany\Pricing\Model\Plugin\TierPrice" />
</config>
TierPrice class:
<?php
namespace MyCompany\Pricing\Model\Plugin;
class TierPrice extends \Magento\Catalog\Pricing\Price\TierPrice
{
public function getTierPriceList()
{
//custom code goes here, return original for now.
return parent::getTierPriceList();
}
}