Opening a till (cash drawer) via PHP
Moderator: General Moderators
- robster
- Forum Contributor
- Posts: 360
- Joined: Wed Jul 16, 2003 8:28 am
- Location: Sunshine Coast, Australia
Opening a till (cash drawer) via PHP
Hi everyone,
I'm writing some POS software for my wifes business and we're having issues with money dissapearing from our cashbox. So I've decided we have to have a cash drawer that only opens when instructed from the PC. Our software I've written for POS is in PHP with MySQL as the database. It all works well and records which employee does the transaction.
What I now need is to get the cash drawer to open when instructed.
The question is, how can I get PHP to do this? (please note the machine is an imac running OSX 10.x)
Here are the cash drawer styles I'm looking at:
http://www.downtown.com.au/hsc1081.htm
http://www.vantex.com.au/product.asp?pID=9325&cID=1538
and the usb version http://www.vantex.com.au/product.asp?pID=9331&cID=1540
Obviously there are many variants but you get the idea.
If anyone could point me in the direction of interfacing hardware, or even better, if you've worked with cash drawer opening via PHP before, I'd really appreciate any help.
Thanks for your time...
Rob
EDIT: I am using PHP 4.x on the mac
I'm writing some POS software for my wifes business and we're having issues with money dissapearing from our cashbox. So I've decided we have to have a cash drawer that only opens when instructed from the PC. Our software I've written for POS is in PHP with MySQL as the database. It all works well and records which employee does the transaction.
What I now need is to get the cash drawer to open when instructed.
The question is, how can I get PHP to do this? (please note the machine is an imac running OSX 10.x)
Here are the cash drawer styles I'm looking at:
http://www.downtown.com.au/hsc1081.htm
http://www.vantex.com.au/product.asp?pID=9325&cID=1538
and the usb version http://www.vantex.com.au/product.asp?pID=9331&cID=1540
Obviously there are many variants but you get the idea.
If anyone could point me in the direction of interfacing hardware, or even better, if you've worked with cash drawer opening via PHP before, I'd really appreciate any help.
Thanks for your time...
Rob
EDIT: I am using PHP 4.x on the mac
- robster
- Forum Contributor
- Posts: 360
- Joined: Wed Jul 16, 2003 8:28 am
- Location: Sunshine Coast, Australia
sorry yes, I forgot to mention, the whole machine (imac) is just there on the counter, it does its thing and will be connected to the drawer.
I see what you're saying, write an app in another language (perhaps applescript or some other batch processing language) and then call that from php (as i've seen php can run external apps).
Sounds like i've got my answer.
I guess the other question is, USB or seriel (and the mac has no seriel port, but they say you can get a dongle/converter). Does anyone know anything about this kind of thing?
Thanks again
Rob
I see what you're saying, write an app in another language (perhaps applescript or some other batch processing language) and then call that from php (as i've seen php can run external apps).
Sounds like i've got my answer.
I guess the other question is, USB or seriel (and the mac has no seriel port, but they say you can get a dongle/converter). Does anyone know anything about this kind of thing?
Thanks again
Rob
I run a mac myself, and have used such a converter, but I would always take the USB approach over a serial conversion. USB is more than fine for this type of use.
If the company is growing, I'd suggest running the switch on a seperate computer acting as a server. Then use a switch to control input from multiple cash registers.
This project sounds like fun... perked my interest.
If the company is growing, I'd suggest running the switch on a seperate computer acting as a server. Then use a switch to control input from multiple cash registers.
This project sounds like fun... perked my interest.
- robster
- Forum Contributor
- Posts: 360
- Joined: Wed Jul 16, 2003 8:28 am
- Location: Sunshine Coast, Australia
The company is growing, but still very small in reality and we only need the one machine. (This is a hair salon).
My only concern with the USB device (drawer) is the need for a driver, and if so, how to open it. It appears that the seriel ones open just from recieving data from the seriel port, whereas the USB one seems to need more than this. I guess it's whether or not there is a USB drawer with a mac driver, and an app I can call (or make an app I can call) from PHP.
It is interesting, and it will be fun to see my PHP code, in the browser, open the till (in real life!).

Thanks everyone for the help, but don't feel you have to stop, if you can think of anything/find anything out there I'm of course very grateful. I'll also keep anyone interested up to date with how the project goes.
Rob
My only concern with the USB device (drawer) is the need for a driver, and if so, how to open it. It appears that the seriel ones open just from recieving data from the seriel port, whereas the USB one seems to need more than this. I guess it's whether or not there is a USB drawer with a mac driver, and an app I can call (or make an app I can call) from PHP.
It is interesting, and it will be fun to see my PHP code, in the browser, open the till (in real life!).
Thanks everyone for the help, but don't feel you have to stop, if you can think of anything/find anything out there I'm of course very grateful. I'll also keep anyone interested up to date with how the project goes.
Rob
I would assume buying a cash register with a USB port, would come with the appropriate software to open the till... no?
AppleScript the open through their software (running in background), then run that script from PHP. Remove all confusion by letting their code do it.
Although, the software they send may do exactly what your php script is doing... but then again, maybe not, I've never used one.
AppleScript the open through their software (running in background), then run that script from PHP. Remove all confusion by letting their code do it.
Although, the software they send may do exactly what your php script is doing... but then again, maybe not, I've never used one.
Another thing you might want to invest in is a decent quality security cammera. My family fast food business was having the same problem as you with money walking away. We bought a security system and ran it through the computer/cash register. Ever since we rarely have money missing where as before it use to be as much as $120/day going missing.
A fake camera might even work. Its all about them knowing your watching.
Just my 2 cents.
A fake camera might even work. Its all about them knowing your watching.
Just my 2 cents.
- n00b Saibot
- DevNet Resident
- Posts: 1452
- Joined: Fri Dec 24, 2004 2:59 am
- Location: Lucknow, UP, India
- Contact:
-
Charles256
- DevNet Resident
- Posts: 1375
- Joined: Fri Sep 16, 2005 9:06 pm
Re: Opening a till (cash drawer) via PHP
I'm in the same trouble here. Has anyone gotten the solution to this? I have developed my POS already, now my client came to me that he has purchased a till machine and now he wants me to integrate it in the app. I wrote the app using PHP. Waiting for answers THANKS
Re: Opening a till (cash drawer) via PHP
This is a post from 2005. Please create a new thread explaining your problem in detail.