試圖讓所有產品在類別問題下是我的代碼有問題。希望對我做錯的任何幫助有所幫助。這是我的代碼。檢索所有產品下的所有產品
$cattegoryId= Mage::registry('current_category');
$category = Mage::getModel('catalog/category')->load($categoryId);
$_productCollection = Mage::getModel('catalog/category')
->getCollection()
->addAttributeToSelect('*')
->addAttributeToFilter('category_id',$category)
->setOrder('entity_id', 'DESC')
->load()
;
你會得到什麼錯誤信息? –
SQLSTATE [42000]:語法錯誤或訪問衝突:1064您的SQL語法錯誤;檢查相應的手冊;和一段代碼錯誤的東西 – Tonzkie