ACSD-64431: The placeOrder mutation that contains the coupon code information in the request throws…
The placeOrder mutation that contains the coupon code information in the request throws an internal error, instead of placing the order successfully. Quality patch ACSD-64431 for magento/module-sales-graph-ql applies to Magento Open Source and Adobe Commerce 2.4.7 to 2.4.7-p10.
- Categories
- GraphQL, Order/Checkout
- Components
- magento/module-sales-graph-ql, magento/module-sales-rule-graph-ql
- Origin
- adobe-commerce-support
- Since QPT
- 1.1.61
Issue
The placeOrder mutation that contains the coupon code information in the request throws an internal error, instead of placing the order successfully.
Steps to reproduce
1. Create a simple product with _SKU 2836611_. 1. Create a Cart Price Rule, set Coupon to Specific Coupon and enter _TEST1234_ as the coupon code. 1. Create a customer: mutation { createCustomer( input: { firstname: "John" lastname: "Doe" email: "john.doe@example.com" password: "b1b2b3l@w+" is_subscribed: true } ) { customer { firstname lastname email is_subscribed } } } 1. Generate a customer token. You can use this token for subsequent requests. mutation { generateCustomerToken(email: "john.doe@example.com", password: "b1b2b3l@w+") { token } } 1. Create an empty cart. Save the cart ID and use it for the subsequent requests. mutation { createEmptyCart } 1. Add the product to the cart: 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 } } } 1. Apply the coupon: 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 } } } } } 1. Set a shipping address: 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 } } } } } 1. Set a shipping method: 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 } } } } } } 1. Set a billing address: 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 } } } } } 1. Set a payment method: mutation { setPaymentMethodOnCart( input: { cart_id: "xxxx", payment_method: { code: "checkmo" } } ) { cart { selected_payment_method { code } } } } 1. Place the order: mutation { placeOrder( input: { cart_id: "{{cart_id}}" } ) { orderV2 { number token } errors { message code } } }
Adobe's page lists 2.4.7 - 2.4.7-p4 as compatible; the versions below are resolved from the current QPT constraints and are the ones the tool will offer.
Adobe scheduled the permanent fix for 2.4.8.
Install
Install the Quality Patches Tool with composer require magento/quality-patches, apply the prerequisites listed for all files applicable to your distribution and version first, then run vendor/bin/magento-patches apply ACSD-64431. On Cloud, add ACSD-64431 under stage.build.QUALITY_PATCHES in .magento.env.yaml.
For cweagans/composer-patches, choose a compatible version below and download the bundle. Copy its ACSD-64431/ folder into patches/composer/, merge composer.patches.json into composer.json, then run composer install. Bundle prerequisites the same way and list them first. Paths are relative to each package root, using the default -p1 level. Prefer local files when configuring composer-patches; a remote URL can change.
Patch files and compatible versions
magento/magento2-base >=2.4.7 <2.4.8
- Magento Open Source
- 2.4.7-p10, 2.4.7-p9, 2.4.7-p8, 2.4.7-p7, 2.4.7-p6, 2.4.7-p5, 2.4.7-p4, 2.4.7-p3, 2.4.7-p2, 2.4.7-p1, 2.4.7
- Adobe Commerce
- 2.4.7-p10, 2.4.7-p9, 2.4.7-p8, 2.4.7-p7, 2.4.7-p6, 2.4.7-p5, 2.4.7-p4, 2.4.7-p3, 2.4.7-p2, 2.4.7-p1, 2.4.7
- Patch file
- patches/os/ACSD-64431_2.4.7-p3.patch
- vendor/magento/module-sales-graph-ql/Model/Resolver/OrderTotal.php
- vendor/magento/module-sales-rule-graph-ql/Model/Resolver/Coupon.php
