public function testPreparePriceData() { $data = [['website_id' => 0, 'cust_group' => 1, 'price_qty' => 2, 'price' => 8], ['website_id' => 0, 'cust_group' => 1, 'price_qty' => 5, 'price' => 5], ['website_id' => 1, 'cust_group' => 1, 'price_qty' => 5, 'price' => 5]]; $newData = $this->_model->preparePriceData($data, \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE, 1); $this->assertEquals(2, count($newData)); $this->assertArrayHasKey('1-2', $newData); $this->assertArrayHasKey('1-5', $newData); }
/** * {@inheritdoc} */ public function preparePriceData(array $priceData, $productTypeId, $websiteId) { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'preparePriceData'); if (!$pluginInfo) { return parent::preparePriceData($priceData, $productTypeId, $websiteId); } else { return $this->___callPlugins('preparePriceData', func_get_args(), $pluginInfo); } }