本文整理汇总了PHP中Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection::joinField方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection::joinField方法的具体用法?PHP Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection::joinField怎么用?PHP Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection::joinField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection
的用法示例。
在下文中一共展示了Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection::joinField方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}