Yes, it is okay. But it might sound more natural to say, "the store", if you only wanted to go to one store. When I say this, I might also say the stores "were" closed, to match the past tense "wanted to" in the first clause. So I might say,
"I wanted to get you something, but the store was closed."