Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bigcommerce API update product issue "The field 'calculated_price' cannot be written to. Please remove it from your request before trying again"

can any one help us to solve this issue....

Fatal error: Uncaught Client Error (400): The field 'calculated_price' cannot be written to. Please remove it from your request before trying again.

            $old_product = Bigcommerce_Api::getProduct($bid);
    $old_product->name              = $_POST['part_number'];
    $old_product->price             = $_POST['price'];
    $old_product->weight            = $_POST['weight'];
    $old_product->width             = $_POST['width'];
    $old_product->categories        = array($_POST['categories']);
    $old_product->height            = $_POST['height'];
    $old_product->depth             = $_POST['depth'];
    $old_product->description       = $_POST['longdescription'];
    $old_product->update();
like image 868
Anakbhai Gida Avatar asked Jun 26 '14 07:06

Anakbhai Gida


1 Answers

using Bigcommerce::updateProduct() method works, try this

$fields = array(
    "name"  => $_POST['part_number'],
    "price" => $_POST['price'],
    //more fields here...
);

Bigcommerce::updateProduct($old_product->id, $fields);
like image 56
Cano64 Avatar answered Nov 02 '22 17:11

Cano64