Get WooCommerce Product ID by SKU

Sometimes you need to get a product’s ID by SKU code. Here’s a little helper function to do just that!

Add the above function to your theme’s functions.php¬†file. Then to use it, just run the function like so:


Leave a Reply

Your email address will not be published. Required fields are marked *