From 4ffc0812ce71c5722683917caa2944eb4e6a32bb Mon Sep 17 00:00:00 2001 From: Denis Seghetti Date: Fri, 4 Oct 2019 11:47:33 +0200 Subject: [PATCH] Update CashOnDelivery.php In row 168 it is better to include isVirtual() check within the conditional block, so the method isVirtual will be called only if $quote is not empty. --- .../Phoenix/CashOnDelivery/Model/CashOnDelivery.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/code/community/Phoenix/CashOnDelivery/Model/CashOnDelivery.php b/app/code/community/Phoenix/CashOnDelivery/Model/CashOnDelivery.php index 08aec89..fdf348e 100644 --- a/app/code/community/Phoenix/CashOnDelivery/Model/CashOnDelivery.php +++ b/app/code/community/Phoenix/CashOnDelivery/Model/CashOnDelivery.php @@ -164,16 +164,16 @@ public function getAddressCodTaxAmount(Mage_Customer_Model_Address_Abstract $add * @return bool */ public function isAvailable($quote = null) - { - if ($quote->isVirtual()) { - return false; - } - + { if (!parent::isAvailable($quote)) { return false; } if (!is_null($quote)) { + if ($quote->isVirtual()) { + return false; + } + if ($this->getConfigData('shippingallowspecific', $quote->getStoreId()) == 1) { $country = $quote->getShippingAddress()->getCountry(); $availableCountries = $this->getConfigData('shippingspecificcountry', $quote->getStoreId());