Skip to content
This repository has been archived by the owner on Aug 1, 2018. It is now read-only.

Commit

Permalink
Disable CashOnDelivery if cart contains virtual products
Browse files Browse the repository at this point in the history
  • Loading branch information
giacmir committed Nov 13, 2017
1 parent aad28f4 commit 1b2e005
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Model/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ public function isAvailable(\Magento\Quote\Api\Data\CartInterface $quote = null)
return false;
}

if ($quote->getItemVirtualQty() > 0) {
return false; //can't use this method if cart contains virtual products
}

$excludeRegions = $this->_scopeConfig->getValue(static::XML_PATH_EXCLUDE_REGIONS);

if (!empty($excludeRegions)) {
Expand Down

0 comments on commit 1b2e005

Please sign in to comment.