No, the order doesn't matter
You cannot cast another spell if you've cast a bonus action spell, and you can't cast a bonus action spell if you've already cast a spell with your action.
"You can't cast another spell during the same turn, except for a cantrip with a casting time of one action" (PHB 202)
That precludes both before or after the action spell.
You were quoted the rules incorrectly.
First, Eldritch Blast has a casting time of 1 action (PHB p.237). You've only got one action on your turn, so you can only cast Eldritch Blast once. ("Off the shelf," that is. There are features, like the Sorceror's Quickened Spell, Action Surge, or even time stop that might change this.)
Boom. That's it. They can't cast a second eldritch blast as a bonus action, because the casting time of eldritch blast isn't "1 bonus action." (Compare with, say, healing word.)
But that's understandable.
It is possible for a caster to cast a spell as a bonus action and another as an action in one turn; the conditions are described exactly on PHB p.202:
- one spell has casting time of 1 bonus action,
- you've not used a bonus action for anything else this turn (because you can only take one bonus action per turn),
- the other spell is a cantrip,
- the other spell has a casting time of 1 action.
D&D is a great game in many ways. It has never, in my experience, been presented in its published materials in a way that makes sense to someone who doesn't already know the game. One player misunderstood something, and no other players nor the GM knew the rule well enough to course-correct mid-session.
That's fine. You now know. Alert your group as soon as possible and be ready for a group conversation about whether this should now be a table-rule, or will this just have been one shining moment in 'Lock's career. "Hey, guys, remember that one day when I was in beast-mode? My patron must have been having me on!"
Best Answer
No.
Cantrips are spells, just like any other spell. There are 2 differences between a Cantrip and any other spell that has a level of 1 or higher:
Cantrips still have casting times denoted just like other spells. For Firebolt
You'll notice that it still has a casting time of 1 action.
There do exist ways to change the casting time of spells. For example, the sorcerer's Quickened Spell would allow you to cast two Firebolts on one turn: One as a Quickened spell, and the other as a normal spell.
There is a complication to this issue, as pointed out to me by Drunk Cynic:
A careful reading of this section reveals that you can only use a bonus action to cast bonus action spells, and you cannot trade standard actions for bonus actions in 5e as demonstrated in this question: https://rpg.stackexchange.com/a/55902/25601