当前位置: 首页>>代码示例>>PHP>>正文


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怎么用?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);
 }
开发者ID:gewaechshaus,项目名称:groupscatalog2,代码行数:14,代码来源:Filter.php

示例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());
     }
 }
开发者ID:aniljaiswal,项目名称:order-confirmation,代码行数:19,代码来源:Filter.php

示例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;
 }
开发者ID:hazaeluz,项目名称:magento_connect,代码行数:22,代码来源:Index.php


注:本文中的Mage_Catalog_Model_Resource_Product_Collection::getProductCountSelect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。