Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add price when adding product #7

Open
utpal4job opened this issue Jul 23, 2013 · 0 comments
Open

Add price when adding product #7

utpal4job opened this issue Jul 23, 2013 · 0 comments

Comments

@utpal4job
Copy link

Hello, I want to add price on new product through api. Below is the code which i am using to add new product. Can you please tell me where is the error.


$newproduct = array
(
"product"=>array
(
"title"=>"Product again",
"body_html"=>"testing product",
"vendor"=>"Vendor",
"product_type"=>"Test",
"variants": [ {"price": 12.00 } ]
)
);

    foreach($newproduct["product"] as $k => $v){
        $newproduct["product"][$k] = iconv("UTF-8", "ISO-8859-2", $v);
    }

    $senditem = $sc->call('POST', '/admin/products.json', $newproduct, $response_headers);

Thanks in advance.

Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant