Magento添加库存或数量大于1的随机项目
我希望筛选只有库存或数量>=1的项目 我的代码:Magento添加库存或数量大于1的随机项目,magento,random,Magento,Random,我希望筛选只有库存或数量>=1的项目 我的代码: $_category = Mage::getModel('catalog/category')->load($this->getCategoryId()); $_productCollection = Mage::getResourceModel('catalog/product_collection') ->addAttributeToSelect('*')
$_category = Mage::getModel('catalog/category')->load($this->getCategoryId());
$_productCollection = Mage::getResourceModel('catalog/product_collection')
->addAttributeToSelect('*')
->addAttributeToFilter('sku', array('gt' => 140));
$_productCollection->getSelect()->order(new Zend_Db_Expr('RAND()'));
$_productCollection->setPage(1, 8);
我试图添加->addAttributeToFilter'is_in_stock'、'1';但是没有运气。@user1139767如果你把答案贴在下面,可能会对其他人有所帮助。