Shopify - 更新变体

时间:2015-08-31 08:25:14

标签: shopify

我的第一个Shopify商店现在运行了大约一个月,使用PHP批处理脚本创建新产品和变体,或者在现有的基于Web的产品管理系统中根据需要进行更新。一切似乎都运行良好,但我只是注意到我在更新变种时遇到异常。我确定之前一直运行良好(能够根据需要更新变体),所以我可以帮助找出现在失败的原因。

以下是一个例子:

ShopifyApiException Object
(
[method:protected] => PUT
[path:protected] => /admin/variants/4294967295.json
[params:protected] => Array
    (
        [variant] => Array
            (
                [price] => 8.00
                [sku] => 2217
                [id] => 2217
                [product_id] => 21880
                [inventory_management] => shopify
                [inventory_policy] => deny
                [inventory_quantity] => 1
                [option1] => Plain \/ EX
                [option2] => Strictly Rhythm
                [option3] => SR12216
                [weight] => 330
                [weight_unit] => g
            )

    )

[response_headers:protected] => Array
    (
        [http_status_message] => Not Found
        [http_status_code] => 404
        [server] => nginx
        [date] => Fri, 21 Aug 2015 14:27:03 GMT
        [content-type] => application/json; charset=utf-8
        [transfer-encoding] => chunked
        [connection] => keep-alive
        [vary] => Accept-Encoding
        [x-sorting-hat-podid] => 3
        [x-sorting-hat-shopid] => 2234339
        [x-sorting-hat-podid-cached] => 1
        [x-sorting-hat-shopid-cached] => 1
        [status] => 404 Not Found
        [x-frame-options] => DENY
        [x-shopid] => 2234339
        [x-shardid] => 3
        [x-shopify-shop-api-call-limit] => 1/40
        [http_x_shopify_shop_api_call_limit] => 1/40
        [x-stats-userid] => 0
        [x-stats-apiclientid] => 152673
        [x-stats-apipermissionid] => 3265975
        [x-xss-protection] => 1; mode=block; report=/xss-report/97471013-3a3c-4b82-a94d-868f9b7ac073?source%5Baction%5D=update&source%5Bcontroller%5D=admin%2Fproduct_variants&source%5Bsection%5D=admin
        [set-cookie] => request_method=PUT; path=/
        [x-request-id] => 97471013-3a3c-4b82-a94d-868f9b7ac073
    )

[response:protected] => Array
    (
        [errors] => Not Found
    )

[message:protected] => Not Found
[string:Exception:private] =>
[code:protected] => 404
[file:protected] => /var/www/MY-SERVER/httpdocs/shopify_tools/shopify.php
[line:protected] => 70
[trace:Exception:private] => Array
    (
        [0] => Array
            (
                [file] => /var/www/MY-SERVER/httpdocs/shopify_tools/batch_upload_items.php
                [line] => 347
                [function] => call
                [class] => ShopifyClient
                [type] => ->
                [args] => Array
                    (
                        [0] => PUT
                        [1] => /admin/variants/4294967295.json
                        [2] => Array
                            (
                                [variant] => Array
                                    (
                                        [price] => 8.00
                                        [sku] => 2217
                                        [id] => 2217
                                        [product_id] => 21880
                                        [inventory_management] => shopify
                                        [inventory_policy] => deny
                                        [inventory_quantity] => 1
                                        [option1] => Plain \/ EX
                                        [option2] => Strictly Rhythm
                                        [option3] => SR12216
                                        [weight] => 330
                                        [weight_unit] => g
                                    )

                            )

                    )

            )

    )

[previous:Exception:private] =>
)

1 个答案:

答案 0 :(得分:1)

我意识到了这个问题 - 希望这可能有助于其他人。

我将Shopify Variant ID存储在我的数据库的INT列中,Shopify Variant ID刚刚超过了INT限制4294967295 - 切换到BIGINT并重新导入所有Variant ID解决了这个问题。