As a French, I'll have answered " Hier, j'ai acheté des gâteaux à la pâtisserie". By the way, there is a problem with tense, you can't says "Hier, " + present, it must be "Hier, " + past.
Since "à" is not a valid answer, let's try other ones:
A - chez. Hier, j'ai acheté des gâteaux chez la pâtisserie. "Chez" has to be used with a person. The correct sentence would have been "Hier, j'ai acheté des gâteaux chez le pâtissier." (Pâtissier means pastry cook)
B - de. Hier, j'ai acheté des gâteaux de la pâtisserie. No problem, it means you bought some pastries which came from the pastry (the building). It's a bit redundant but technically correct.
C - pour. Hier, j'ai acheté des gâteaux pour la pâtisserie. Here it means that you bought pastries in order to bring them to a pastry (the building). While this sentence could be said, you'll never do that.
So if I had to take a guess, I'll say B - de. It's not the perfect answer but it's the best of the three. C - pour could have been too but b - de is more common and correct.