Hi,
This thread is mostly related to my old thread (http://coding-talk.com/f14/%5Bneed%5...-search-18367/). After doing all this okay with the help of CreativityKills, now I'm stuck with with another issue. That is, when I have only one phone on the stock, two or more user put this phone on the cart at the same time and after that ordering the same phone could create a major issue for me as I've only one phone on the stock.
Let me clear the issue elaborately:
1. I've 1 Samsung S3 phone on my stock.
2. Now putting the phone on the session by one user and he can order the phone easily.
3. But if 2 or more users put the phone on their cart session could be a major problem for me.
What I did in this circumstance: I checked the phone whether its available or not with the following code before the phone going on the cart.
but when someone put it on the cart and don't order it, it creates another mess. That is the phone remain unsold but showing the its not in the stock. because of this issue.
now I've decided to check it while ordering the phone(s).
Now here in this point I need assistance from you. I've one or more then one phone on the cart and I need to check whether its available or not and if its not available redirects with the one which isn't available. and if all are available then process the order.
Can anybody help me with this please?
This thread is mostly related to my old thread (http://coding-talk.com/f14/%5Bneed%5...-search-18367/). After doing all this okay with the help of CreativityKills, now I'm stuck with with another issue. That is, when I have only one phone on the stock, two or more user put this phone on the cart at the same time and after that ordering the same phone could create a major issue for me as I've only one phone on the stock.
Let me clear the issue elaborately:
1. I've 1 Samsung S3 phone on my stock.
2. Now putting the phone on the session by one user and he can order the phone easily.
3. But if 2 or more users put the phone on their cart session could be a major problem for me.
What I did in this circumstance: I checked the phone whether its available or not with the following code before the phone going on the cart.
PHP Code:
$q2=mysql_num_rows(mysql_query("SELECT available FROM phone_info WHERE id='$phid'"));
if($q2!=0)
{
//putting the processing code
}
else{
//redirecting with not available code
}
now I've decided to check it while ordering the phone(s).
Now here in this point I need assistance from you. I've one or more then one phone on the cart and I need to check whether its available or not and if its not available redirects with the one which isn't available. and if all are available then process the order.
Can anybody help me with this please?
Comment