예제 #1
0
 /**
  * @magentoAppIsolation enabled
  * @covers \Magento\CatalogRule\Model\Rule::calcProductPriceRule
  */
 public function testCalcProductPriceRule()
 {
     $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Catalog\\Model\\Product');
     $this->assertEquals($this->_object->calcProductPriceRule($product, 100), 45);
     $product->setParentId(true);
     $this->assertEquals($this->_object->calcProductPriceRule($product, 50), 5);
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function calcProductPriceRule(\Magento\Catalog\Model\Product $product, $price)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'calcProductPriceRule');
     if (!$pluginInfo) {
         return parent::calcProductPriceRule($product, $price);
     } else {
         return $this->___callPlugins('calcProductPriceRule', func_get_args(), $pluginInfo);
     }
 }