ACSD-64431:リクエストのクーポンコードを含む「placeOrder」ミューテーションで、内部サーバーエラーがスローされる
ACSD-64431 パッチは、リクエスト内にクーポンコード情報を含む placeOrder ームバリエーションが、注文を正常に行わずに内部サーバーエラーをスローする問題を修正しました。 このパッチは、Quality Patches Tool (QPT) 1.1.61 がインストールされている場合に使用できます。 パッチ ID は ACSD-64431 です。 この問題はAdobe Commerce 2.4.8 で修正される予定であることに注意してください。
影響を受ける製品とバージョン
Adobe Commerce バージョン用のパッチが作成されます。
- Adobe Commerce(すべてのデプロイメント方法) 2.4.7-p3
Adobe Commerce バージョンとの互換性:
- Adobe Commerce(すべてのデプロイメント方法) 2.4.7 - 2.4.7-p4
magento/quality-patches パッケージを最新バージョンに更新し、Quality Patches Tool: Search for patches page で互換性を確認します。 パッチ ID を検索キーワードとして使用して、パッチを見つけます。問題
リクエストにクーポンコード情報を含む placeOrder の突然変異は、注文を正常に行うのではなく、内部エラーをスローします。
再現手順 :
-
SKU 2836611 を使用してシンプルな製品を作成します。
-
Cart Price Rule を作成し、Coupon を
Specific Couponに設定して、クーポンコードとして TEST1234 と入力します。 -
顧客を作成します。
code language-none mutation { createCustomer( input: { firstname: "John" lastname: "Doe" email: "john.doe@example.com" password: "b1b2b3l@w+" is_subscribed: true } ) { customer { firstname lastname email is_subscribed } } } -
顧客トークンを生成します。 以降のリクエストでこのトークンを使用できます。
code language-none mutation { generateCustomerToken(email: "john.doe@example.com", password: "b1b2b3l@w+") { token } } -
空の買い物かごを作成します。 カート ID を保存し、後続のリクエストで使用します。
code language-none mutation { createEmptyCart } -
商品を買い物かごに追加します。
code language-none mutation { addProductsToCart( cartId: "xxxx" cartItems: [{ quantity: 1, sku: "2836611" }] ) { cart { itemsV2 { items { product { name sku } ... on ConfigurableCartItem { configurable_options { configurable_product_option_uid value_label } } quantity } total_count page_info { page_size current_page total_pages } } } user_errors { code message } } } -
クーポンを適用します。
code language-none mutation { applyCouponToCart(input: { cart_id: "xxxx", coupon_code: "TEST1234" }) { cart { itemsV2 { items { product { name } quantity } total_count page_info { page_size current_page total_pages } } applied_coupons { code } prices { grand_total { value currency } } } } } -
配送先住所の設定:
code language-none mutation { setShippingAddressesOnCart( input: { cart_id: "xxxxx" shipping_addresses: [ { address: { firstname: "John" lastname: "Doe" company: "Company Name" street: ["3320 N Crescent Dr", "Beverly Hills"] city: "Los Angeles" region: "CA" region_id: 12 postcode: "90210" country_code: "US" telephone: "123-456-0000" save_in_address_book: false } } ] } ) { cart { shipping_addresses { firstname lastname company street city region { code label } postcode telephone country { code label } available_shipping_methods { carrier_code carrier_title method_code method_title } } } } } -
出荷方法を設定します。
code language-none mutation { setShippingMethodsOnCart( input: { cart_id: "xxxx" shipping_methods: [{ carrier_code: "flatrate", method_code: "flatrate" }] } ) { cart { shipping_addresses { selected_shipping_method { carrier_code carrier_title method_code method_title amount { value currency } } } } } } -
請求先住所の設定:
code language-none mutation { setBillingAddressOnCart( input: { cart_id: "xxxx" billing_address: { address: { firstname: "John" lastname: "Doe" company: "Company Name" street: ["64 Strawberry Dr", "Beverly Hills"] city: "Los Angeles" region: "CA" region_id: 12 postcode: "90210" country_code: "US" telephone: "123-456-0000" save_in_address_book: true } } } ) { cart { billing_address { firstname lastname company street city region { code label } postcode telephone country { code label } } } } } -
支払方法を設定します。
code language-none mutation { setPaymentMethodOnCart( input: { cart_id: "xxxx", payment_method: { code: "checkmo" } } ) { cart { selected_payment_method { code } } } } -
注文する:
code language-none mutation { placeOrder( input: { cart_id: "{{cart_id}}" } ) { orderV2 { number token } errors { message code } } }
期待される結果 :
注文する必要があります。
実際の結果 :
次のエラーメッセージが表示されます。"message": "Internal server error"
exception.log には、次のエラーが含まれます。
report.ERROR: "discount_model" value should be specifiedGraphQL (1:135)
1: mutation { placeOrder(input: {cart_id: "xxxx"}) { orderV2 { total { discounts { amount { currency value } coupon { code } } } } errors { message code } } }
パッチの適用
個々のパッチを適用するには、デプロイメント方法に応じて、次のリンクを使用します。
- Adobe CommerceまたはMagento Open Source オンプレミス:Quality Patches Tool > 使用状況 Quality Patches Tool ガイドに記載されています。
- クラウドインフラストラクチャー上のAdobe Commerce:クラウドインフラストラクチャー上のCommerce ガイドの アップグレードとパッチ / パッチの適用」を参照してください。
関連資料
Quality Patches Tool について詳しくは、以下を参照してください。
- Quality Patches Tool: 『ツールガイド』にあるクオリティパッチ セルフサービスツール。