Domanda

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.

È stato utile?

Soluzione

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
    ]
)
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a magento.stackexchange
scroll top