I am trying to figure out how to create downloadable woocommerce products. Trouble is syntax for the --downloads
argument for $ wp wc product create
.
It appears that the downloads argument should be one ore more objets having "id", "name", "file" specifications. The toughest one to figure is "id". I tried using the specs for a download file associated with another product. Still get an []
empty value for that new product when I ask:
$ wp wc product list --fields=id,name,downloads
$ wp wc product create --name="CLI Test Downloads" --type=simple --regular_price=20 --downloadable=true --downloads=[{"id":"2d40862d-0044-4da6-bd87-0e94bf5531d6","name":"e-SIGNES-53no2.pdf","file":"https:\/\/ventardlab.info\/wp-content\/uploads\/2019\/01\/e-53no2.pdf"}]
I get no error message, just that product is created. But when I check the new product in the WordPress dashboard, there are no download file included.