Skip to content

Programmatically creating new order in Woocommerce

I am having the hardest time programmatically creating an order in WooCommerce. I am using the code below and is DOES create an order BUT I cannot get customer information OR product line items added to the order. The new order that is create is simply as Guest with no items, user information, etc. The issue …

Fingerprint comparison with php

I have a small device which scans fingerprints. There i have an image of the fingerprint. I hope i can get some “Bio-ID” of this fingerprint image and send this id to a server. The server side can …

Get user role by ID WordPress

I need to somehow check someone’s role with only their id. I have found the current_user_can() check. But this only works for people that are logged in. How would I check for this if that user isn’t the current user? I am using a phone order system but that uses the admin/specific account to order…

PHP foreach not looping

I’m new in programming and just started php like two months ago. So far I seemed to understand it more and more. But now I am stumped. I have a foreach loop that won’t loop through the array I’m feeding it. I have checked the syntax and logic over and over again and can’t find the prob…

What is the actual memory cost of storing an integer?

lets say I just do this So I store 10 integers in an array. If the integer is a 32b one, the memory cost should be 40 bytes. Problem is, I didn’t tell php that it is an integer so it either has to store it as something else? (js likes to make doubles for example) or keep extra data

How to validate a sale with PayPal REST API and IPN

I currently have a fully working cart and checkout process through PayPal _xcart method, but I want to migrate it to REST API, mainly because I want to mitigate the possibility of price-jacking. Currently my IPN does check for price jack and sets the according flags so the product doesn’t get downloaded…