我在使用shopifyapi从库存商品id获取变体时遇到问题。下面是来自 ShopifyAPI::Variant.find(:all)
:
{"id"=>40232259485873, "title"=>"red", "price"=>"10.00", "sku"=>"1", "position"=>1, "inventory_policy"=>"deny", "compare_at_price"=>nil, "fulfillment_service"=>"manual", "inventory_management"=>"shopify", "option1"=>"red", "option2"=>nil, "option3"=>nil, "created_at"=>"2021-06-26T15:22:08-04:00", "updated_at"=>"2021-07-14T22:49:15-04:00", "taxable"=>true, "barcode"=>"", "grams"=>0, "image_id"=>nil, "weight"=>0.0, "weight_unit"=>"kg", "inventory_item_id"=>42322551111851, "inventory_quantity"=>8, "requires_shipping"=>true, "admin_graphql_api_id"=>"gid://shopify/ProductVariant/41111111111111"}
正如你所看到的 inventory_item_id
是 42322551111851
. 但当我这么做的时候: product_variant = ShopifyAPI::Variant.find(:all, :params=> {:inventory_item_id => 42322551111851).first
,我得到的变体与 inventory_item_id
是我指定的。我使用的是api版本2021-04。任何帮助都会很好!
暂无答案!
目前还没有任何答案,快来回答吧!