wordpress - Woocommerce 2.6 API v1 -> Invalid parameter -
i'm trying add products woocommerce wordpress api per https://github.com/woothemes/wc-api-php
i using wordpress api /wp-json/wc/v1
this data
array ( [type] => simple [name] => bike [regular_price] => 300 [description] => new bike )
then $woocommerce->post('products',$data);
but regular_price won't work. without it works fine, when add errors
invalid parameter regular_price [rest_invalid_param]
not sure if exact error, translated dutch
any ideas?
solved! regular_price has string, assigned integer it
changed
$wcproduct['regular_price'] = $moxpart->price;
to
$wcproduct['regular_price'] = (string)$moxpart->price;
Thanks. You helped me out. I had the same issue.
ReplyDelete