Guest User

Untitled

a guest
Feb 24th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. $products = Mage::getModel('catalog/product')->getCollection(); $products->addAttributeToSelect(array('name', 'thumbnail', 'price')); //feel free to add any other attribues you need. Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
  2.  
  3. Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products); Mage::getModel('cataloginventory/stock_item')->loadByProduct($products); $products->getSelect()->order('RAND()'); $products->getSelect()->limit(6);
Add Comment
Please, Sign In to add comment