0

the default Magento2 report from ordered products excludes orders with status canceled. I also want to exclude status closed.

/app/code/Magento/Reports/Model/ResourceModel/Product/Sold/Collection.php

in line 60 shows

  $connection->quoteInto("{$orderTableAliasName}.state <> ?", \Magento\Sales\Model\Order::STATE_CANCELED),

How can I add STATE_CLOSED here? I tried a bit but no success.

2

your condition should be in your case

$connection->quoteInto(
    "{$orderTableAliasName}.state NOT IN (?)", 
    [
        \Magento\Sales\Model\Order::STATE_CANCELED, 
        \Magento\Sales\Model\Order::STATE_CLOSED
    ]
)
2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.