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;


Comments

Post a Comment

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -