Skip to content

Instantly share code, notes, and snippets.

@ScreamingDev
Last active December 18, 2015 05:49
Show Gist options
  • Select an option

  • Save ScreamingDev/5735938 to your computer and use it in GitHub Desktop.

Select an option

Save ScreamingDev/5735938 to your computer and use it in GitHub Desktop.
Why does this not get random products?
<?php
include 'app/Mage.php';
Mage::app('default');
/* @var $collection Mage_Catalog_Model_Resource_Product_Collection */
$collection = Mage::getModel('catalog/product')->getCollection();
var_dump($collection->getLoadedIds()); // array()
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment