本文整理汇总了PHP中Magento\Catalog\Model\Product\Type::priceFactory方法的典型用法代码示例。如果您正苦于以下问题:PHP Type::priceFactory方法的具体用法?PHP Type::priceFactory怎么用?PHP Type::priceFactory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Catalog\Model\Product\Type
的用法示例。
在下文中一共展示了Type::priceFactory方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: priceFactory
/**
* {@inheritdoc}
*/
public function priceFactory($productType)
{
$pluginInfo = $this->pluginList->getNext($this->subjectType, 'priceFactory');
if (!$pluginInfo) {
return parent::priceFactory($productType);
} else {
return $this->___callPlugins('priceFactory', func_get_args(), $pluginInfo);
}
}
示例2: preparePriceData
/**
* Prepare group prices data for website
*
* @param array $priceData
* @param string $productTypeId
* @param int $websiteId
* @return array
*/
public function preparePriceData(array $priceData, $productTypeId, $websiteId)
{
$rates = $this->_getWebsiteCurrencyRates();
$data = [];
$price = $this->_catalogProductType->priceFactory($productTypeId);
foreach ($priceData as $v) {
$key = join('-', array_merge([$v['cust_group']], $this->_getAdditionalUniqueFields($v)));
if ($v['website_id'] == $websiteId) {
$data[$key] = $v;
$data[$key]['website_price'] = $v['price'];
} elseif ($v['website_id'] == 0 && !isset($data[$key])) {
$data[$key] = $v;
$data[$key]['website_id'] = $websiteId;
if ($this->_isPriceFixed($price)) {
$data[$key]['price'] = $v['price'] * $rates[$websiteId]['rate'];
$data[$key]['website_price'] = $v['price'] * $rates[$websiteId]['rate'];
}
}
}
return $data;
}
示例3: testPriceFactory
/**
* @param sring|null $typeId
* @param string $expectedClass
* @dataProvider priceFactoryDataProvider
*/
public function testPriceFactory($typeId, $expectedClass)
{
$type = $this->_productType->priceFactory($typeId);
$this->assertInstanceOf($expectedClass, $type);
}
示例4: getPriceModel
/**
* Get product price model
*
* @return \Magento\Catalog\Model\Product\Type\Price
*/
public function getPriceModel()
{
return $this->_catalogProductType->priceFactory($this->getTypeId());
}