문제

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.

도움이 되었습니까?

해결책

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
    ]
)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top