如何更新" INVENTORY_LEVEL"通过的Bigcommerce SKU编号的产品? [英] How to update "inventory_level" of product by sku id in Bigcommerce?

查看:184
本文介绍了如何更新" INVENTORY_LEVEL"通过的Bigcommerce SKU编号的产品?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想更新产品的库存水平但遗憾的是没有得到success.Here是我的code。
我想更新产品的INVENTORY_LEVEL,但让这样做的。

 < PHP要求bigcommerce.php
使用的Bigcommerce \\阿比\\客户为的Bigcommerce;
::的Bigcommerce配置(阵列(
    store_url'=> https://store-nos85a.mybigcommerce.com/',
    用户名= GT; '管理员',
    API_KEY'=> 4b7c4bba19f290a728e00be6ae7133cda71f477b
    ));::的Bigcommerce setCipher('RC4-SHA');
::的Bigcommerce verifyPeer(假);
            $产品=的Bigcommerce :: getProduct(76);
            的print_r($产品 - >的SKU);
                       的foreach($产品 - >的SKU为$ SKU)
                        {                            如果($ sku-> ID == 5)
                                {
                              $栏=阵列(INVENTORY_LEVEL=> 112);
                              ::的Bigcommerce的UpdateProduct(76,$领域);
                                }
                            回声ID:$ sku-> ID。
                            回声Invntory级别:$ sku-> INVENTORY_LEVEL< BR />中;
                            回声SKU:$ sku-> SKU< BR />中;                        }
?>在这里的Bigcommerce :: UpdateProduct中(76,$场);不工作..
请帮帮我..
谢谢..


解决方案

我试图做同样的事情(不同的编程语言)。我有一个电话到他们的支持。好像你还必须参考的product_id。

您不能SKU简单地更新。你必须知道的PRODUCT_ID。我周围这让通过要求所有产品和加载的响应到一个数组(产品,SKU等)。我然后使用相关的product_id读阵列THRU,获得使用SKU我们的系统的数量,和post(PUT)的INVENTORY_LEVEL。

恕我直言,这是对他们的一部分了巨大的监督。谁在乎的PRODUCT_ID是在网站上呢?

我要求的增强,允许更新,以SKU。

I am trying to update the inventory level of a products but unfortunately not getting success.Here is my code. I want to update product's "inventory_level" but enable to do so..

<?php

require "bigcommerce.php";
use Bigcommerce\Api\Client as Bigcommerce;


Bigcommerce::configure(array(
    'store_url' => 'https://store-nos85a.mybigcommerce.com/',
    'username' => 'admin',
    'api_key' => '4b7c4bba19f290a728e00be6ae7133cda71f477b'
    ));

Bigcommerce::setCipher('RC4-SHA');
Bigcommerce::verifyPeer(false);
            $product = Bigcommerce::getProduct(76); 
            print_r($product->skus);
                       foreach($product->skus as $sku)
                        {

                            if($sku->id==5)
                                {
                              $fields = array("inventory_level"=>112);
                              Bigcommerce::updateProduct(76,$fields);
                                }
                            echo "id :  ".$sku->id;
                            echo " Invntory Level: ".$sku->inventory_level."<br/>";
                            echo " SKU : ".$sku->sku."<br/>";

                        }


?>

Here " Bigcommerce::updateProduct(76,$field); " is not working..
Please Help me..
Thanks..

解决方案

I am trying to do the same thing (different programming language). I have a call into their support. It seems like you still must reference the product_id.

You cannot update simply by SKU. You must know the product_id. I got around this by requesting all products and loading the response into an array (product_id, sku, etc.). I then read thru the array, get the quantity from our system using the SKU, and post (PUT) the inventory_level using the associated product_id.

IMHO this is a huge oversight on their part. Who cares what the product_id is on the website?

I have asked for an enhancement that allows updating by SKU.

这篇关于如何更新&QUOT; INVENTORY_LEVEL&QUOT;通过的Bigcommerce SKU编号的产品?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆