In fact, you can buy it on the same day, as long as everything on the cake shelf can be bought.
But I'm afraid you won't get the cake you want when you go that day, so you'd better make a reservation in advance for safety. There is no need to advance much. A day or two is enough. In fact, if there is a cake embryo you want in the store, you can order it in the morning and get it in the afternoon.