ACSD-57086: Orders from non-default websites with terms and conditions enabled are processed incorrectly

The ACSD-57086 patch fixes the issue where orders placed from non-default websites with terms and conditions enabled are not processed correctly. This patch is available when the Quality Patches Tool (QPT) 1.1.49 is installed. The patch ID is ACSD-57086. Please note that this issue was fixed in Adobe Commerce 2.4.7.

Affected products and versions

The patch is created for Adobe Commerce version:

  • Adobe Commerce (all deployment methods) 2.4.5-p5

Compatible with Adobe Commerce versions:

  • Adobe Commerce (all deployment methods) 2.4.3 - 2.4.6-p7
NOTE
The patch might become applicable to other versions with new Quality Patches Tool releases. To check if the patch is compatible with your Adobe Commerce version, update the magento/quality-patches package to the latest version and check the compatibility on the Quality Patches Tool: Search for patches page. Use the patch ID as a search keyword to locate the patch.

Issue

While using a multi-store setup with AsyncOrder processing, orders placed on any websites/stores other than the main website are rejected due to issues with scope handling in the queue consumer code.

Steps to reproduce:

  1. Install RabbitMQ and execute bin/magento setup:upgrade to create the queues for RabbitMQ.

  2. Configure AsyncOrder processing with:

    code language-bash
    bin/magento setup:config:set --checkout-async 1
    
  3. Create a secondary website, a store, and a store view.

  4. Create a product that is shared between both websites.

  5. Enable terms and conditions:

    1. Go to Stores > Configuration > Sales > Checkout > Checkout Options.
    2. Set Enable Terms And Conditions to Yes.
  6. Configure terms and conditions for both the websites:

    1. Go to Stores > Terms And Conditions > Add New Condition.

    2. Use the following settings:

      • Condition Name: Anything
      • Status: Enabled
      • Applied: Manually
      • Store View: Default Store View
    3. Create another condition for the second website/store view.

  7. Change the default website by going to Stores > All Stores. Click the second website, check Set as Default and save.

  8. Clear the cache with:

    code language-bash
    bin/magento cache:clear
    
  9. Go to the Storefront and add a product to the cart. Proceed to checkout and place an order (you should see a checkbox in the payment method step to accept the terms and conditions).

  10. Go back to Admin after placing the order, and change the default website back to the original main website and save.

  11. Clear the cache:

    code language-bash
    bin/magento cache:clear
    
  12. Run the following command to start the queue consumer:

    code language-bash
    bin/magento queue:cons:start placeOrderProcessor
    

Expected results:

Order is fulfilled; it is not automatically rejected.

Actual results:

Order status is rejected with the following comment:

The order wasn’t placed. First, agree to the terms and conditions, then try placing your order again.

Apply the patch

To apply individual patches, use the following links depending on your deployment method:

To learn more about Quality Patches Tool, refer to:

For info about other patches available in QPT, refer to Quality Patches Tool: Search for patches in the Quality Patches Tool guide.

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