本文整理汇总了PHP中Mage_Catalog_Model_Resource_Product_Collection::getProductCountSelect方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Catalog_Model_Resource_Product_Collection::getProductCountSelect方法的具体用法?PHP Mage_Catalog_Model_Resource_Product_Collection::getProductCountSelect怎么用?PHP Mage_Catalog_Model_Resource_Product_Collection::getProductCountSelect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Catalog_Model_Resource_Product_Collection
的用法示例。
在下文中一共展示了Mage_Catalog_Model_Resource_Product_Collection::getProductCountSelect方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addGroupsCatalogFilterToProductCollectionCountSelect
/**
* Inner join the groupscatalog index table to not count products
* not visible to the specified customer group id
*
* @param Mage_Catalog_Model_Resource_Product_Collection $collection
* @param int $groupId
* @return void
*/
public function addGroupsCatalogFilterToProductCollectionCountSelect(Mage_Catalog_Model_Resource_Product_Collection $collection, $groupId)
{
$select = $collection->getProductCountSelect();
$storeId = $collection->getStoreId();
$this->addGroupsCatalogProductFilterToSelect($select, $groupId, $storeId);
}
示例2: addGroupsCatalogFilterToProductCollectionCountSelect
/**
* Inner join the groupscatalog index table to not count products
* not visible to the specified customer group id
*
* @param Mage_Catalog_Model_Resource_Product_Collection $collection
* @param int $groupId
* @return void
*/
public function addGroupsCatalogFilterToProductCollectionCountSelect(Mage_Catalog_Model_Resource_Product_Collection $collection, $groupId)
{
/* @var $helper Netzarbeiter_GroupsCatalog2_Helper_Data */
$helper = Mage::helper('netzarbeiter_groupscatalog2');
// Switch index table depending on the specified entity
$this->_init($helper->getIndexTableByEntityType(Mage_Catalog_Model_Product::ENTITY), 'id');
if ($this->_doesIndexExists()) {
$table = $this->getTable($helper->getIndexTableByEntityType(Mage_Catalog_Model_Product::ENTITY));
$this->_addGroupsCatalogFilterToSelect($collection->getProductCountSelect(), $table, $groupId, $collection->getStoreId());
}
}
示例3: addIndexToProductCount
/**
* Add index to product count select in product collection
*
* @param Mage_Catalog_Model_Resource_Product_Collection $collection
* @param int $customerGroupId
* @return Enterprise_CatalogPermissions_Model_Resource_Permission_Index
*/
public function addIndexToProductCount($collection, $customerGroupId)
{
$adapter = $this->_getReadAdapter();
$parts = $collection->getSelect()->getPart(Zend_Db_Select::FROM);
if (isset($parts['permission_index_product'])) {
return $this;
}
$collection->getProductCountSelect()->joinLeft(array('permission_index_product_count' => $this->getTable('permission_index_product')), 'permission_index_product_count.category_id = count_table.category_id' . ' AND permission_index_product_count.product_id = count_table.product_id' . ' AND permission_index_product_count.store_id = count_table.store_id' . ' AND ' . $adapter->quoteInto('permission_index_product_count.customer_group_id=?', $customerGroupId), array());
if (!Mage::helper('enterprise_catalogpermissions')->isAllowedCategoryView()) {
$collection->getProductCountSelect()->where('permission_index_product_count.grant_catalog_category_view = ?', Enterprise_CatalogPermissions_Model_Permission::PERMISSION_ALLOW);
} else {
$collection->getProductCountSelect()->where('permission_index_product_count.grant_catalog_category_view != ?' . ' OR permission_index_product_count.grant_catalog_category_view IS NULL', Enterprise_CatalogPermissions_Model_Permission::PERMISSION_DENY);
}
return $this;
}