Creating a credit memo / refund programmatically (Magento 1)

The following code creates a Magento credit memo / refund.

Creating order including custom options programmatically (Magento 1)

Using the following code, you can create an order including custom options programmatically.

Getting a list of all countries (Magento 1)

Use the code below to get a list of all countries. It can be used to create a country dropdown list for example.

Loading a model without using IDs (Magento 1)

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.

Afterwards, it is possible to iterate over the…