弊社の通販サイトにて、cart/add.jsとcart/change.jsを呼び出していますが返却したjsonにはsectionsがnullで返却しています。そのためカート内容表示時にエラーとなりました。
今はlocation.reload()で画面更新、カートをliquidでレンダリングさせています
(注文個数などの変更内容はサーバ側には反映されている)
不具合は回避していますがスマートな振る舞いではないため、sectionsの内容でカートを更新したいと考えています。
以下リクエスト/レスポンス内容です。
request
{> “quantity”: “1”,> “form_type”: “product”,> “utf8”: “✓”,> “id”: “40953839976608”,> “sections”: [> “cart-notification-product”,> “cart-notification-button”,> “cart-icon-bubble”> ],> “sections_url”: “/products/3-g”> }
response
{> “id”: 40953839976608,> “properties”: {},> “quantity”: 4,> “variant_id”: 40953839976608,> “key”: “40953839976608:513e59a469a8686443925289e69e695a”,> “title”: “【無添加 梅干し 】紀州梅香の減塩つぶれ梅 500g(中粒~大粒) - 3-G”,> “price”: 185000,> “original_price”: 185000,> “discounted_price”: 185000,> “line_price”: 740000,> “original_line_price”: 740000,> “total_discount”: 0,> “discounts”: ,> “sku”: “y-umeboshi-3p-500g”,> “grams”: 1000,> “vendor”: “農業法人 紀州梅香”,> “taxable”: true,> “product_id”: 5881889783968,> “product_has_only_default_variant”: true,> “gift_card”: false,> “final_price”: 185000,> “final_line_price”: 740000,> “url”: “/products/3-g?variant=40953839976608”,> “featured_image”: {> “aspect_ratio”: 1,> “alt”: “【無添加 梅干し 】紀州梅香の減塩つぶれ梅 500g(中粒~大粒) - 3-G”,> “height”: 1000,> “url”: “https://cdn.shopify.com/s/files/1/0516/7765/9296/products/3-g_1.png?v=1643182770”,> “width”: 1000> },> “image”: “https://cdn.shopify.com/s/files/1/0516/7765/9296/products/3-g_1.png?v=1643182770”,> “handle”: “3-g”,> “requires_shipping”: true,> “product_type”: “梅干し”,> “product_title”: “【無添加 梅干し 】紀州梅香の減塩つぶれ梅 500g(中粒~大粒) - 3-G”,> “product_description”: “この商品は「農薬使用7割減の つぶれ 減塩(…”,> “variant_title”: null,> “variant_options”: [> “Default Title”> ],> “options_with_values”: [> {> “name”: “Title”,> “value”: “Default Title”> }> ],> “line_level_discount_allocations”: ,> “line_level_total_discount”: 0,> “sections”: null> }
(product_description:だけ省略..しています)
ソース修正時の「プレビュー」でadd.jsを利用すると、sectionsの内容が戻ってきます。
しかしプレビューと同じJsonでリクエストしてみても、本番ドメインではsectionsはnullとなっています。
1,2ヶ月まえまでは上記のリクエストでsectionsは取得できていたように思えます。
リクエスト内容は正しいでしょうか?
以上お手数ですが、宜しくお願い致します