It wasn't until 1961 that the Berlin Wall that was set up, what was to prevent the West Berliners from going over to the east?
Note that food was rationed at that time, not generally bought.
Wikipedia says, emphasis mine:
In response, starting on 1 August, the Soviets offered free food to anyone who crossed into East Berlin and registered their ration cards there, but West Berliners overwhelmingly rejected Soviet offers of food.
So, yes you could get your food in East Berlin, but it basically meant "giving in", becoming a citizen of the Soviet zone.
Note that most people in West Berlin were quite happy to not be part of the Soviet sector, and wanted things to stay that way.
West Berlin wasn't just shut off to the Allies, it was under total blockade. Quoting from the relevant Wikipedia article:
On 24 June, the Soviets severed land and water connections between the non-Soviet zones and Berlin. That same day, they halted all rail and barge traffic in and out of Berlin. On 25 June, the Soviets stopped supplying food to the civilian population in the non-Soviet sectors of Berlin. Motor traffic from Berlin to the western zones was permitted, but this required a 23-kilometer (14.3-mile) detour to a ferry crossing because of alleged "repairs" to a bridge. They also cut off the electricity relied on by Berlin, using their control over the generating plants in the Soviet zone. Surface traffic from non-Soviet zones to Berlin was blockaded, leaving open only the air corridors.
After WW2, the German currency (The Reichsmark) took a large hit in value, both due to losing the war, and the Soviets continuing to print RMs (precisely to prevent the economic recovery of Germany). The Western Governments, to facilitate the recovery of (Western) Germany introduced the Deutsche Mark (DM), which the Soviets disapproved of, banning the use of the DM in the eastern sector, while introducing their own new currency for their sector.
Due to Berlin's status as an enclave within the Soviet zone, the Western Allies did not initially introduce the DM to Berlin, seeking a agreement with the Soviets. As the Soviets were against the new currency in general, they refused, and decided to introduce their new currency to their sector, including Berlin. This led to the West introducing the DM to their sectors of Berlin
The introduction of the DM to Berlin was what precipitated the Blockade, and one of the goals of the Soviets was to force West Berlin to adopt the Eastern Currency. By forcing the West Berliners to purchase food from the east, the Soviets would have insured that the only currency they could use was theirs. Due to the success of the Airlift, this was never required of West Berlin, which kept the DM over the East Mark.
The precipitating reason for the blockade is on page 18 of Miller's To Save a City.