Step-by-step explanation:
The correct sentence structure that make sense would be;
Frank and Gina went to the store to buy Christmas gifts and food, but the food was sold out by the time Frank and Gina got there.
The above sentence structure is an example of a compound sentence when a conjunction is used to connect two sentences. Here the but has been used as a conjunction to define a link between first sentence and second sentence.
In compound sentences, sometimes the order of the sentences is important also like in above case