MCQs > IT & Programming > Magento > Which code sample will display products from a certain category in random order?

Magento MCQs

Which of the following code samples will display products from a certain category in random order?

Answer

Correct Answer: $products = Mage::getModel('catalog/product') ->getCollection() ->addAttributeToSort() ->addAttributeToSelect('*'') ->addCategoryFilter(Mage::getModel('catalog/category')->load()); $products->getSelect()->order(new Zend_Db_Expr('RAND()'));

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Magento Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Magento Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it