Product queries
wcgetproducts and WCProductQuery provide a standard way of retrieving products that is safe to use and will not break due to database changes in future WooCommerce versions. Building custom WPQueries or database queries is likely to break your code in future versions of WooCommerce as data moves towards custom tables for better performance. This is the best-practices way for plugin and theme developers to retrieve multiple products. wcgetproducts and WCProductQuery are similar to WordPress getposts and WPQuery. Just like those, you pass in an array of arguments defining the criteria for the search.
Custom product fields
In this tutorial you will learn how to create a custom field for a product and show it in your store. Together we will set up the skeleton plugin, and learn about WP naming conventions and WooCommerce hooks. In the end, you will have a functioning plugin for adding a custom field.