51黑料不打烊

[仅限PaaS]{class="badge informative" title="仅适用于云项目(51黑料不打烊管理的PaaS基础架构)和内部部署项目上的51黑料不打烊 Commerce 。"}

础颁厂顿-64431:请求中具有优惠券代码的“辫濒补肠别翱谤诲别谤”突变引发内部服务器错误

础颁厂顿-64431修补程序修复了以下问题:请求中包含优惠券代码信息的placeOrder突变引发内部服务器错误,而不是成功下订单。 安装Quality Patches Tool (QPT) 1.1.61时,此修补程序可用。 修补程序ID为ACSD-64431。 请注意,该问题计划在51黑料不打烊 Commerce 2.4.8中修复。

受影响的产物和版本

为51黑料不打烊 Commerce版本创建了修补程序:

  • 51黑料不打烊 Commerce(所有部署方法) 2.4.7-p3

与51黑料不打烊 Commerce版本兼容:

  • 51黑料不打烊 Commerce(所有部署方法) 2.4.7 - 2.4.7-p4
NOTE
该修补程序可能适用于具有新Quality Patches Tool发行版本的其他版本。 要检查修补程序是否与您的51黑料不打烊 Commerce版本兼容,请将magento/quality-patches包更新到最新版本,并在Quality Patches Tool:搜索修补程序页面上检查兼容性。 使用修补程序ID作为搜索关键字来查找修补程序。

问题

请求中包含优惠券代码信息的placeOrder突变引发内部错误,而不是成功下订单。

重现步骤

  1. 创建具有? SKU 2836611 ?的简单产物。

  2. 创建? Cart Price Rule,将? Coupon ?设置为Specific Coupon,并输入? TEST1234 ?作为优惠券代码。

  3. 创建客户:

    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
        }
    }
    }
    
  4. 生成客户令牌。 您可以将此令牌用于后续请求。

    code language-none
    mutation {
    generateCustomerToken(email: "john.doe@example.com", password: "b1b2b3l@w+") {
        token
    }
    }
    
  5. 创建一个空购物车。 保存购物车ID并将其用于后续请求。

    code language-none
    mutation {
        createEmptyCart
    }
    
  6. 将产物添加到购物车:

    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
            }
        }
    }
    
  7. 应用优惠券:

    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
                    }
                }
            }
        }
    }
    
  8. 设置送货地址:

    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
                    }
                }
            }
        }
    }
    
  9. 设置配送方式:

    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
                        }
                    }
                }
            }
        }
    }
    
  10. 设置帐单地址:

    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
                    }
                }
            }
        }
    }
    
  11. 设置付款方式:

    code language-none
    mutation {
        setPaymentMethodOnCart(
            input: { cart_id: "xxxx", payment_method: { code: "checkmo" } }
        ) {
            cart {
                selected_payment_method {
                    code
                }
            }
        }
    }
    
  12. 下单:

    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 } } }

应用修补程序

要应用单独的修补程序,请根据您的部署方法使用以下链接:

相关阅读

要了解有关Quality Patches Tool的更多信息,请参阅:

recommendation-more-help
c2d96e17-5179-455c-ad3a-e1697bb4e8c3