Liquid、JavaScriptなどに関する質問
商品にフィルターをかけて検索しているのですが、「在庫あり」と「在庫なし」の商品数が合わないです。
下記のレスポンスのfilters.countで「在庫あり=2」と「在庫なし=12」となってますが、管理画面のコレクションに紐づく商品数を見てみると、アーカイブを除いて、「在庫切れ=10」になるはずです。
これはshopifyのバグですか?
もしくはavailable=falseが在庫なしではなく、アーカイブ以外の商品数のことを指しますか?
ご存知の方がいましたら、ご教授願います。
【クエリ】
query getProductsByCollection( \$limit: Int = 10 \$afterCursor: String \$sortKey: ProductCollectionSortKeys \$reverse: Boolean ) { collection(id: "gid://shopify/Collection/460299993388") { products( first: \$limit sortKey: \$sortKey reverse: \$reverse after: \$afterCursor filters:[ { available : true }, ] ) { edges { node { id title variants(first: 1) { edges { node { id title availableForSale } } } } } filters { values { count id input label } } } } }
【レスポンス】
"filters": [ { "values": [ { "count": 2, "id": "filter.v.availability.1", "input": "{\"available\":true}", "label": "在庫あり" }, { "count": 12, "id": "filter.v.availability.0", "input": "{\"available\":false}", "label": "在庫切れ" } ] } ]
解決済! ベストソリューションを見る。
成功
This is an accepted solution.
成功
This is an accepted solution.
いつもShopifyをご利用いただき、ありがとうございます。 Shopifyは、皆様の日本語での利用体験の向上に努めております。さらなる改善のために皆様のご意見をお寄せい...
By JasonH May 9, 2025Shopify アカデミーの学習パスと認定スキルバッジExpanding Your Shopify Business Internationallyを活用して、国際的にビジネ...
By Shopify Feb 7, 2025Shopify アカデミーの学習パスB2B on Shopify:立ち上げとカスタマイズで卸売販売に進出しましょう。これら3つの無料コースは、ShopifyストアでB2B機能...
By Shopify Jan 31, 2025