How to add product in woocommerce with php code?

Posted by Ramesh Singh | Updated on

Its pretty easy one you have worked out the data added in the post meta. Trouble I am having is adding downloadable products to the store.

below is the code i am using it lists all the post meta that is used by woo commerce. This publishes a product however the download link will not attach.

Originally when i started i made an error with the array that stores the download link producing a bad link “b” followed by a second download file that was correct. After fixing the array to match that of a product manually added it no loner will show a file. If anyone has info on this it would be greatly appreciated

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@] Your question and answer will appear on and help other developers.

Related Questions & Answers