This code creates a custom WooCommerce product query using WP_Query enabling you to use any WP_Query parameters.
Installation
There’s only 1 step :
Copy & paste the PHP code ( excluding the opening PHP tag ) from the functions.php file to the end of your child themes functions file or custom functionality plugin.