本文整理汇总了PHP中Magento\Catalog\Model\Resource\Product\Collection::addTierPriceData方法的典型用法代码示例。如果您正苦于以下问题:PHP Collection::addTierPriceData方法的具体用法?PHP Collection::addTierPriceData怎么用?PHP Collection::addTierPriceData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Catalog\Model\Resource\Product\Collection
的用法示例。
在下文中一共展示了Collection::addTierPriceData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testAddTierPriceData
/**
* @magentoDataFixture Magento/Catalog/Model/Resource/_files/product_simple.php
*/
public function testAddTierPriceData()
{
$this->_collection->setFlag('tier_price_added', false);
$this->_collection->addIdFilter(2);
$this->assertInstanceOf('\\Magento\\Catalog\\Model\\Resource\\Product\\Collection', $this->_collection->addTierPriceData());
$tierPrice = $this->_collection->getFirstItem()->getDataByKey('tier_price');
$this->assertEquals($this->_groupManagement->getNotLoggedInGroup()->getId(), current($tierPrice)['cust_group']);
$this->assertEquals($this->_groupManagement->getAllCustomersGroup()->getId(), next($tierPrice)['cust_group']);
$this->assertTrue($this->_collection->getFlag('tier_price_added'));
}
示例2: testAddTierPriceData
/**
* @magentoDataFixture Magento/Catalog/Model/Resource/_files/product_simple.php
*/
public function testAddTierPriceData()
{
$this->_collection->setFlag('tier_price_added', false);
$this->_collection->addIdFilter(2);
$this->assertInstanceOf('\\Magento\\Catalog\\Model\\Resource\\Product\\Collection', $this->_collection->addTierPriceData());
$tierPrice = $this->_collection->getFirstItem()->getDataByKey('tier_price');
$this->assertEquals(CustomerGroupServiceInterface::NOT_LOGGED_IN_ID, current($tierPrice)['cust_group']);
$this->assertEquals(CustomerGroupServiceInterface::CUST_GROUP_ALL, next($tierPrice)['cust_group']);
$this->assertTrue($this->_collection->getFlag('tier_price_added'));
}