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

AbotX : How do you create a parallel crawler that stays on and can be added to at run time from new requests -

testing - Detect whether test has failed within fixture -

android - Create single AAR file from multiple modules using Gradle -