本文整理汇总了PHP中Mage_Catalog_Block_Product_List::getLoadedProductCollection方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Catalog_Block_Product_List::getLoadedProductCollection方法的具体用法?PHP Mage_Catalog_Block_Product_List::getLoadedProductCollection怎么用?PHP Mage_Catalog_Block_Product_List::getLoadedProductCollection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Catalog_Block_Product_List
的用法示例。
在下文中一共展示了Mage_Catalog_Block_Product_List::getLoadedProductCollection方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: collect
/**
* Collects list of objects in product list
*
* @param Mage_Catalog_Block_Product_List $object
* @return Mage_Catalog_Model_Product[]
*/
public function collect($object)
{
$result = array();
$products = $object->getLoadedProductCollection();
foreach ($products as $product) {
$result[] = $product;
}
return $result;
}
示例2: testSetCollection
public function testSetCollection()
{
$this->_block->setCollection('test');
$this->assertEquals('test', $this->_block->getLoadedProductCollection());
}
示例3: _processCatalogProductList
/**
* @param string $html
* @param Mage_Catalog_Block_Product_List $block
* @return string
*/
private function _processCatalogProductList($html, $block)
{
$helper = $this->_getHelper();
/** @var $processor Mageplace_Callforprice_Model_Htmlprocessor_Interface */
$processor = Mage::getModel('mageplace_callforprice/htmlprocessor_factory')->createProcessor();
$processor->load($html);
if ($helper->isGlobalEnabled()) {
$processor->replace($helper->getCssSelector('product_list_price'), $helper->prepareReplacement());
$processor->remove($helper->getCssSelector('product_list_addtocart'));
return $processor->getHtml();
}
/** @var $parent Mage_Catalog_Block_Category_View */
$parent = $block->getParentBlock();
if ($parent instanceof Mage_Catalog_Block_Category_View && ($category = $parent->getCurrentCategory())) {
if ($helper->isEnabledForCategory($category)) {
$processor->replace($helper->getCssSelector('product_list_price'), $helper->prepareReplacement());
return $processor->getHtml();
}
}
$processor->process('productlist', array('products' => $block->getLoadedProductCollection()));
return $processor->getHtml();
}
示例4: getLoadedProductCollection
/**
* Fires a custom event we can catch in the observer and process
* the products where the add-to-cart-button should be hidden
*
* @return Mage_Eav_Model_Entity_Collection_Abstract
*/
public function getLoadedProductCollection()
{
$oProductCollection = parent::getLoadedProductCollection();
Mage::dispatchEvent('sitewards_b2bprofessional_product_list_collection_load_after', array('product_collection' => $oProductCollection));
return $oProductCollection;
}
示例5: appendToCatalogListing
/**
* Appends the points balance in the header somewhere
* @param Mage_Catalog_Block_Product_List $block
* @param Varien_Object $transport
*/
public function appendToCatalogListing($block, $transport)
{
// Should we be checking this auto-integration?
if (!Mage::getStoreConfigFlag('rewards/autointegration/product_listing')) {
return $this;
}
// Block is a price block.
if (!$block instanceof Mage_Catalog_Block_Product_List) {
return $this;
}
$all_products = $block->getLoadedProductCollection();
$html = $transport->getHtml();
$html = $this->_getNewCatalogListingHtml($html, $all_products);
$transport->setHtml($html);
return $this;
}