Hello,
By default, there is no way to set all new products to be external products, but you can definitely import the new products via CSV and set them to be external/affiliates.
To learn more about the format for the CSV file please check:
https://github.com/woocommerce/woocommerce/wiki/Product-CSV-Import-Schema
Once you have the file you can import it into your store, you can refer to this documentation below:
https://woocommerce.com/document/product-csv-importer-exporter/
I hope this provides clarity.
Can’t add a piece of code to function.php to set it up?
Hello,
I found this piece of code that seems to change the default product type:
https://stackoverflow.com/questions/55728698/set-the-product-type-to-variable-by-default-in-admin-new-product-pages/#answer-55729384
You can replace variable with external to make it work the way you like.
I would recommend using a plugin like Code Snippets to add the code to your site.
Thank you.
But this code snippet does not apply if I feed products to the site using an API, which means it’s not really a definition within woocommerce.
I need for another code that affects the core of woocommerce.
Hi @the1first
You will want to edit the WooCommerce REST API integration in order to set the product type of your new products as “External/Affiliate product”. You can find WooCommerce REST API documentations in the links below, covering authentication and all the endpoints and parameters that can be accessed via the REST API:
https://docs.woocommerce.com/document/woocommerce-rest-api/
https://woocommerce.github.io/woocommerce-rest-api-docs/#introduction
You can also hire a developer or one of the customization experts listed here:
https://woocommerce.com/customizations/
As a workaround, you can run a bulk edit after importing your products.
I can recommend the following plugins from the WooCommerce Extensions Store:
You can also check the link below for some other relevant extensions:
https://ww.wp.xz.cn/plugins/search/woocommerce+bulk+edit/
I hope that helps