Skip to content

Admin order creation fails when "Include Tax In Order Total" set to yes #2675

@erikhansen

Description

@erikhansen

Steps to reproduce issue:

  1. Install Magento CE 2.0.0 with sample data.
  2. Ensure that developer mode is turned on.
  3. Go to Stores > Configuration > SALES > Tax > Shopping Cart Display Settings and change the "Include Tax In Order Total" value to "Yes".
  4. Go to Sales > Orders > Create New Order
  5. You will see this error: Notice: Undefined index: tax in vendor/magento/module-sales/Block/Adminhtml/Order/Create/Totals/Grandtotal.php on line 77 Full backtrace available here

This problem occurs because the \Magento\Tax\Model\Sales\Total\Quote\Tax::collect collector only returns a value if there are items in a quote. And since the quote won't contain any items, the "tax" collector isn't present in the totals array. I'll be submitting a PR to fix this shortly.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions