Sometimes there is no id available for loading a model. If thats the case, the following code might help out. It loads a collection by an attribute like name or sku.
|
1 |
$collectionData = Mage::getModel('modelname')->getCollection()->addFieldToFilter('attribute', 'attribute value'); |
Afterwards, it is possible to iterate over the collection, get the id and load the model using that id.
Loading a model without using IDs
Need help implementing this solution, or still looking for a fix to your Magento problem? Get in touch and I will be happy to help with your project.