How do I get all the invoices collection?
I know that to get all the orders is:
$orders = Mage::getModel(sales/order)->getCollection();
However I can't seem to find the equivalent with invoice (it's not sales/invoice). Sorry if it's a dumb question.
You need to use :
For the explanation :
When you want to access i block/model/resource/helper/etc in magento :
first, you choose the right method to access it :
Mage::getModel
for a modelsecond, you must tell magento "which" module you want to access. You do that with the first part of the parameter string :
This string refers to the XML node of the type or resource you want to access. In your case, for accessing a model of the Mage_Sales module : take a look at the Mage_Sales's config.xml, you'll see the node to use (used for models and resourceModels) :
Mage_Sales_Model
), you'll see a fileInvoice.php
in theOrder
folder : then you path is "order_invoice" and the full commande to access your model is :