I dont think I understand the question. You want to import CSV file, there are plugins that can do it. You need not to care of their code (although it is of course php).
Thread Starter
RazyRx
(@razyrx)
Hi @superkot,
I need information about function or class of WooCommerce that uses to import products to call it from my plugin. Plugin already loads CSV file from server and place it in uploads folder, but i want to use WooCommerce importer to import products from this file.
Regards,
Oleg
Woocommerce does not have its own import, as far as I know. You need to process your CSV file line by line, creating a “product” WordPress post type per each line and populate it with data.
This link might help:
http://lukasznowicki.info/insert-new-woocommerce-product-programmatically/
Thread Starter
RazyRx
(@razyrx)
Hi @superkot,
On the WooCommerce site https://woocommerce.com/products/product-csv-import-suite/
NOTE: A new product import/export feature is built into WooCommerce as of the 3.1 release, launched in June 2017. We aim to phase out this extension over time and include its features and functionality directly in WooCommerce. Until then, Product CSV Import Suite is here for you with the benefits below.
And WooCommerce can Import/Export products from admin panel, but I can’t find any documentation about it.
Regards,
Oleg
Ok, thats new and I’ve missed it.
Thread Starter
RazyRx
(@razyrx)
Hi,
Unfortunately can’t find any function to import products from file like woocommerce_import($filename);.
For now I am uses code from do_ajax_product_import function from WC_Admin_Importers class and this work normal, but doesn’t work at all from multisite for specific blog.
Regards,
Oleg