I am using woocommerce and I need to add an entry to a sperate database with order details and custom Fields.
I use the code snippits plugin but I need to know what functions to use to trigger the code when the order is marked completed and how to get the product details.
I think the easy way for me to keep this stable would be to have my function get the data and POST it to a script at the card system which would handle writing the data to the database. The only Fields I need are the Buyers Name, Phone, and Email; the SKU of the voucher; and the custom field (card_type).
To give a little more background we are selling passes to a local fire museum. The pass is a variable product with different quantities as different variations. the tracking system I made is a very simple PHP CRUD setup that records the card details and transactions to keep track of the balance. We have lots of different volunteers and I wanted to keep track of the vouchers created by woocommerce in the card tracking system too. That way I dont have to keep adding restricted users to woocommerce. I have to give more permission than I would like in order for them to see and redeem the vouchers.
Customer buys the voucher online, brings it in, and we give them the reusable card.