Skip to content

Add price when adding product  #7

@utpal4job

Description

@utpal4job

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,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions