2

I want to add products in bigcommerce store using bigcommerce Api PHP.

My code is like below:

$fields = array( "name" => "Apple" );
BigCommerce_Api::createBrand($fields);

store is connected successfully but products are not creating.Please help...

4

3 回答 3

2

看起来您正在创建一个品牌而不是产品。如果要创建产品,可以执行以下操作 -

$filter = array('name' => 'iPhone sticker', 'price' => '12.99', 'categories' => array(2), 'type' => 'physical', 'availability' => 'available', 'weight' => 0);
$product = Bigcommerce_Api::createProduct($filter);
于 2013-01-10T23:04:05.100 回答
0
$new_product = new Bigcommerce_Api_Product();
$new_product->name = $_POST['name'];
$new_product->type= "type";
$product = $new_product->create();
于 2013-05-02T12:58:45.943 回答
-1

您可以使用 xml 创建品牌,请查看以下代码:

BigCommerce_Api::useXml();
$xml = '<brand>
          <name>'.$product[brand_name].'</name>
       </brand>';
$brand_exe = BigCommerce_Api::createBrand($xml);
于 2012-12-14T10:13:32.627 回答