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


PHP Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection::addAttributeToSelect方法代码示例

本文整理汇总了PHP中Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection::addAttributeToSelect方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection::addAttributeToSelect方法的具体用法?PHP Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection::addAttributeToSelect怎么用?PHP Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection::addAttributeToSelect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection的用法示例。


在下文中一共展示了Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection::addAttributeToSelect方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: prepareProductCollection

 /**
  * Enter description here...
  *
  * @param Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection $collection
  * @return Mage_Catalog_Model_Layer
  */
 public function prepareProductCollection($collection)
 {
     $collection->addAttributeToSelect('name')->addAttributeToSelect('url_key')->addAttributeToSelect('price')->addAttributeToSelect('special_price')->addAttributeToSelect('special_from_date')->addAttributeToSelect('special_to_date')->joinMinimalPrice()->addAttributeToSelect('description')->addAttributeToSelect('short_description')->addAttributeToSelect('image')->addAttributeToSelect('thumbnail')->addAttributeToSelect('small_image')->addAttributeToSelect('tax_class_id')->addStoreFilter();
     Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
     Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection);
     return $this;
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:13,代码来源:Layer.php

示例2: prepareProductCollection

 /**
  * Prepare product collection
  *
  * @param Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection $collection
  * @return Mage_Catalog_Model_Layer
  */
 public function prepareProductCollection($collection)
 {
     $collection->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())->addSearchFilter(Mage::helper('catalogsearch')->getQuery()->getQueryText())->setStore(Mage::app()->getStore())->addMinimalPrice()->addFinalPrice()->addTaxPercents()->addStoreFilter()->addUrlRewrite();
     Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
     Mage::getSingleton('catalog/product_visibility')->addVisibleInSearchFilterToCollection($collection);
     return $this;
 }
开发者ID:xiaoguizhidao,项目名称:mydigibits,代码行数:13,代码来源:Layer.php

示例3: doCollection

 function doCollection()
 {
     $collection = new Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection();
     $collection->setStoreId(Mage::app()->getStore()->getId());
     $collection->addAttributeToSelect('*');
     Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
     //        Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection);
     return $collection;
 }
开发者ID:hashir-dhattiwala,项目名称:vfmagento,代码行数:9,代码来源:Product.php

示例4: collectValidatedAttributes

 /**
  * Collect validated attributes
  *
  * @param Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection $productCollection
  * @return Mage_CatalogRule_Model_Rule_Condition_Product
  */
 public function collectValidatedAttributes($productCollection)
 {
     $attribute = $this->getAttribute();
     if ($attribute == 'category_ids' || $this->isFilterCustom($attribute)) {
         return $this;
     }
     if ($this->getAttributeObject()->isScopeGlobal()) {
         $attributes = $this->getRule()->getCollectedAttributes();
         $attributes[$attribute] = true;
         $this->getRule()->setCollectedAttributes($attributes);
         $productCollection->addAttributeToSelect($attribute, 'left');
     } else {
         $this->_entityAttributeValues = $productCollection->getAllAttributeValues($attribute);
     }
     return $this;
 }
开发者ID:giuseppemorelli,项目名称:magento-extension,代码行数:22,代码来源:Product.php

示例5: prepareProductCollection

 /**
  * Filter product collection
  *
  * @param Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection $collection
  * @return Mage_Catalog_Model_Layer
  */
 public function prepareProductCollection($collection)
 {
     $rule = $this->getRule();
     if ($rule->getData('show_outofstock') == 2) {
         $collection->joinField('stock_status', 'cataloginventory/stock_status', 'stock_status', 'product_id=entity_id', array('stock_status' => Mage_CatalogInventory_Model_Stock_Status::STATUS_IN_STOCK, 'website_id' => Mage::app()->getWebsite()->getWebsiteId()));
     }
     $collection->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())->addMinimalPrice()->addFinalPrice()->addTaxPercents();
     /*Filter min, max price*/
     $this->currentRate = Mage::app()->getStore()->getCurrentCurrencyRate();
     $max = $this->getMaxPriceFilter();
     $min = $this->getMinPriceFilter();
     if ($min && $max) {
         $collection->getSelect()->where(' final_price >= "' . $min . '" AND final_price <= "' . $max . '" ');
     }
     /*End Filter min, max price*/
     Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
     Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection);
     //$this->_productCollections = $collection;
     return $this;
 }
开发者ID:TusharKDonda,项目名称:maruti,代码行数:26,代码来源:Layer.php

示例6: prepareProductCollection

    /**
     * Initialize product collection
     *
     * @param Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection $collection
     * @return Mage_Catalog_Model_Layer
     */
    public function prepareProductCollection($collection)
    {
        $collection
            ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
            ->addMinimalPrice()
            ->addFinalPrice()
            ->addTaxPercents()
            ->addUrlRewrite($this->getCurrentCategory()->getId());

        Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
        Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection);

        return $this;
    }
开发者ID:ravi2jdesign,项目名称:magentoOLD,代码行数:20,代码来源:Layer.php

示例7: prepareProductCollection

 /**
  * Initialize product collection
  *
  * @param Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection $collection
  * @return Mage_Catalog_Model_Layer
  */
 public function prepareProductCollection($collection)
 {
     if (strtolower($this->getCurrentCategory()->getName()) == "new arrivals") {
         $todayDate = date("Y-m-d H:i:s", Mage::getModel('core/date')->timestamp(time()));
         //$date_band = Mage::getStoreConfig("inventory/date_setting/old_after");
         /*
         if($date_band == ""){
         	$date_band = 100;
         }
         */
         $collection->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())->addMinimalPrice()->addFinalPrice()->addTaxPercents()->addUrlRewrite($this->getCurrentCategory()->getId())->addAttributeToFilter('news_from_date', array('lteq' => $todayDate));
         //$collection->getSelect()->where("DATE_ADD(`at_news_from_date_default`.value,INTERVAL ".$date_band." DAY) >= ?",$todayDate);
     } else {
         $collection->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())->addMinimalPrice()->addFinalPrice()->addTaxPercents()->addUrlRewrite($this->getCurrentCategory()->getId());
     }
     Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
     Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection);
     return $this;
 }
开发者ID:sagmahajan,项目名称:aswan_release,代码行数:25,代码来源:Layer.php

示例8: collectValidatedAttributes

 /**
  * Collect validated attributes
  *
  * @param Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection $productCollection
  * @return Mage_CatalogRule_Model_Rule_Condition_Product
  */
 public function collectValidatedAttributes($productCollection)
 {
     if ($this->getAttribute() == 'category_ids') {
         return $this;
     }
     $attributes = $this->getRule()->getCollectedAttributes();
     $attributes[$this->getAttribute()] = true;
     $this->getRule()->setCollectedAttributes($attributes);
     $productCollection->addAttributeToSelect($this->getAttribute(), 'left');
     return $this;
 }
开发者ID:joebushi,项目名称:magento-mirror,代码行数:17,代码来源:Product.php

示例9: prepareProductCollection

 /**
  * Initialize product collection
  *
  * @param Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection $collection
  * @return Mage_Catalog_Model_Layer
  */
 public function prepareProductCollection($collection)
 {
     $collection->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())->addMinimalPrice()->addFinalPrice()->addTaxPercents()->addUrlRewrite($this->getCurrentCategory()->getId());
     Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
     //Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection);
     $collection->addFieldToFilter('visibility', Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH);
     //$collection->addAttributeToFilter('sku', array('eq' => 'TTE7QSA43'));
     return $this;
 }
开发者ID:axovel,项目名称:easycarcare,代码行数:15,代码来源:Layer.php

示例10: prepareProductCollection

 /**
  * Initialize product collection
  *
  * @param Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection $collection
  * @return Mage_Catalog_Model_Layer
  */
 public function prepareProductCollection($collection)
 {
     $session = Mage::getSingleton('customer/session');
     $isCorporate = FALSE;
     if ($session->isLoggedIn()) {
         $customer = $session->getCustomer();
         $isCorporate = $customer->getZiscorporate();
     }
     $collection->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())->addMinimalPrice()->addFinalPrice()->addTaxPercents()->addUrlRewrite($this->getCurrentCategory()->getId());
     Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
     if ($isCorporate != 470) {
         Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection);
     }
     return $this;
 }
开发者ID:shebin512,项目名称:Magento_Zoff,代码行数:21,代码来源:Layer.php


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