當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。