I have recently created a php script to import new products into Woocommerce. Please see how it was done here How to add product in woocommerce with php code.
The question I have is related to the product type. When you add a new product in the backend you can choose the product type: simple, grouped, external/affiliate, and variable product.
When I create new products with the script it uses the simple product type by default and I cannot find anywhere in the woocommerce database where I can change the product type to external/affiliate. Does anyone know where that data is stored for each product?
I check and double checked the posts and postmeta tables and cannot find anything related to the product type. I attempted a search in the options table but cannot find anything either unless it's encoded in there.
I appreciate any help :)