【问题标题】:Bigcommerce API PHPBigcommerce API PHP
【发布时间】:2012-10-13 11:47:45
【问题描述】:

我想使用 bigcommerce Api PHP 在 bigcommerce 商店中添加产品。

我的代码如下:

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

商店已成功连接,但未创建产品。请帮助...

【问题讨论】:

    标签: php doctrine bigcommerce


    【解决方案1】:

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

    $filter = array('name' => 'iPhone sticker', 'price' => '12.99', 'categories' => array(2), 'type' => 'physical', 'availability' => 'available', 'weight' => 0);
    $product = Bigcommerce_Api::createProduct($filter);
    

    【讨论】:

      【解决方案2】:
      $new_product = new Bigcommerce_Api_Product();
      $new_product->name = $_POST['name'];
      $new_product->type= "type";
      $product = $new_product->create();
      

      【讨论】:

        【解决方案3】:

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

        BigCommerce_Api::useXml();
        $xml = '<brand>
                  <name>'.$product[brand_name].'</name>
               </brand>';
        $brand_exe = BigCommerce_Api::createBrand($xml);
        

        【讨论】:

        • 嗯,XML 不是唯一的方法。不需要使用 XML。您也可以通过 JSON 创建产品。
        猜你喜欢
        • 2016-08-04
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-01-01
        • 1970-01-01
        • 2015-05-14
        相关资源
        最近更新 更多