【发布时间】:2014-01-31 23:37:31
【问题描述】:
有没有办法使用 bigcommerce api 批量更新产品或订单? 如果可能的话,我需要通过一个电话来更新多个产品。
【问题讨论】:
标签: bigcommerce
有没有办法使用 bigcommerce api 批量更新产品或订单? 如果可能的话,我需要通过一个电话来更新多个产品。
【问题讨论】:
标签: bigcommerce
如果你使用的是可以下载的PHP库@https://github.com/bigcommerce/auspost-api-php
我首先使用以下调用创建了一个本地产品数据库...
$filter = array('limit' =>, 'page' =>1);
Bigcommerce::getProducts($filter);
foreach($products as $product){
$sku = $product->SKU;
$id = $product->id;
/* write some code in the loop to add all the products to your DB */
}
一旦您拥有所有产品的数据库,您就可以从数据库中使用 SELECT ALL 进行 SQL 调用,并使用如下所示的一些静态内容更新它们(将每个产品放在下面的循环中)......
$UpdateQuery = array('description' => 'Some Random Text added to all descriptions')
Bigcommerce::updateProduct($Bicommerce_Product_ID,$UpdateQuery)
这将在您的数据库中批量添加“添加到所有描述中的一些随机文本”产品。您需要在每个循环中使用 Bigcommerce 产品 ID 来定位它并“批量”更新。
希望这很有用 - 可以验证它是否可以自己使用 :)
【讨论】: