Saya memiliki kode berikut:
umask(0);
Mage::app();
$category =new Mage_Catalog_Model_Category();
$category->load($cid);
if ($status == "2") {
$products = Mage::getModel('catalog/product')->getCollection()
->addAttributeToSelect('*')
->addFieldToFilter('status',Mage_Catalog_Model_Product_Status::STATUS_DISABLED);
$products->load();
}
if ($status == "1") {
$products = Mage::getModel('catalog/product')->getCollection()
->addAttributeToSelect('*');
$products->load();
}
Saya ingin menambahkan filter jumlah stok untuk menyaring produk, saya mencoba:
$products = Mage::getModel('catalog/product')->getCollection()
->addAttributeToSelect('*');
**->addAttributeToFilter('qty', array("gt" => 0));**
Tapi tidak berhasil, ada ide?