This commit is contained in:
Glenn Hermans 2021-08-19 21:39:07 +02:00 committed by GitHub
parent 41ba95c6cc
commit e4f7c8bb77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -261,6 +261,14 @@ class Order extends Model implements OrderContract
*/
public function canCancel(): bool
{
if ($this->status == 'cashondelivery' && core()->getConfigData('sales.paymentmethods.cashondelivery.generate_invoice')) {
return false;
}
if ($this->status == 'moneytransfer' && core()->getConfigData('sales.paymentmethods.moneytransfer.generate_invoice')) {
return false;
}
if ($this->status === self::STATUS_FRAUD) {
return false;
}