Search code examples
phpprintersnetwork-printers

Receipt printer - print automatically when someone placed an order?


I have bought a receipt printer and connected to Serial COM1 on my computer. I want to print a receipt automatically when someone placed an order online. How can that be done?

I developed a shopping cart website in PHP / MySQL; the server located at the data center.


Solution

  • Ok so your website is in a datacenter, and your printer at home, that kind of sounds like it's not going to work...

    Here's what you need:
    - A network printer or printer server which allows you to add jobs via a web API
    - This API must be reachable from the outside (from the datacenter) so you need a static IP or some service like dyndns...
    - you need to extend your website to send the receipt to the printer queue

    But if I were you, I wouldn't start on making this happen...

    A better solution might be a program which runs on your local computer and connects to the database of your website to check wether orders are placed, and creates a receipt and sends this to the printer...