Peel shallot then thinly slice. Wash spring onion then dry thoroughly with kitchen towel/paper. Cut into long sections (separate the white part and the green part).
Pour oil into a wok (or a deep frying pan). Heat over medium-low heat. Add shallots then leave to simmer until it becomes lightly brown. Turn off the heat (see note 1 & 2). Take out the shallot pieces with chopsticks.
Turn the heat back on. Add the white part of the spring onion. Leave to simmer over medium-low heat until it wrinkles a bit. Add the green part of the spring onion. Turn off the heat when it turns brown (see note 1 & 2).
Pour the oil into a sterilized, airtight jar. Store in the fridge and use it within a month. Use a clean spoon each time you use the oil.
A SIMPLE & FAST VERSION:
You may use only spring onion and cook on a slightly higher heat thus the simmering time will be shorter. Make sure to observe closely during the process to avoid burning.
Notes
1. When the shallot/spring onion starts to brown, you need to turn off the heat straightaway. This is to avoid overcooking which will leave a unpleasant burnt flavour.2. The simmering time may vary depending on the wok and heat source. It takes me about 15 minutes to simmer the shallot and about 10 minutes for the spring onion.3. You may discard the fried shallot and the spring onion or add them to a dish. For example, use them as a topping for Shanghai spring onion oil noodles, or add them to a stir-fried dish.