Ah. That's a separable verb. German has a lot of them, and they're terrible.
Basically, "ein-" is the prefix of "einkaufen", which means "to purchase/shop/buy". With separable verbs, the prefix will be detached from the first verb (the transitive, iirc) and placed at the end, just like infinitive verbs. If you ever see something like that just floating at the end of the sentence, it is almost certainly supposed to be part of the first verb.
So, "Sie kauft in einem Baumarkt ein," translates into, "She shops in a farm market".
And yes, if you forget that prefix, it changes dramatically. It becomes something like "She buys in a farm market", which makes only a vague amount of sense.