Skip to content

Commit e293465

Browse files
luigifabsreichelfballiano
authored
Disable cash on delivery method for virtual orders (#2953)
* Disallow cash on delivery for virtual orders * Update app/code/core/Mage/Payment/Model/Method/Cashondelivery.php Co-authored-by: Sven Reichel <[email protected]> Co-authored-by: Fabrizio Balliano <[email protected]>
1 parent 7c16d61 commit e293465

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

app/code/core/Mage/Payment/Model/Method/Cashondelivery.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,17 @@ public function getInstructions()
5252
{
5353
return trim($this->getConfigData('instructions'));
5454
}
55+
56+
/**
57+
* Not available for quote without delivery
58+
*
59+
* {@inheritDoc}
60+
*/
61+
public function isApplicableToQuote($quote, $checksBitMask)
62+
{
63+
if ($quote->getIsVirtual()) {
64+
return false;
65+
}
66+
return parent::isApplicableToQuote($quote, $checksBitMask);
67+
}
5568
}

0 commit comments

Comments
 (0)