PC 490.5 merely sets forth the penalties for petty theft. You were probably also charged with PC 488 which is the petty theft statute. To be convicted, you must have had the intent to steal the merchandise when you took it. How far you got with it is one factor that could be used to show your intent. The mere fact that you didn't leave the store with it is does not mean you can't be charged with petty theft. But, neither does it mean you will definitely be convicted. It all depends on the specific facts. Consult a criminal defense attorney in your area immediately to protect your rights.
No. Unfortunately, to be charged with PC 490.5, does not require that the merchandise actually be taken outside of the store. But, depending upon the circumstances, it could possibly raise a factor in the defense of the case.
In addition to what my colleagues have advised, I have heard judges say that if the person makes it past the last opportunity to pay for the merchandise (usually the last cash register), even if the person hasn't yet opened a door leading to the outside, that is sufficient to establish that the person had no intent to pay for the goods.