Example #1
0
 /**
  * EC PE won't be available if the EC is available
  *
  * @param \Magento\Sales\Model\Quote|null $quote
  * @return bool
  */
 public function isAvailable($quote = null)
 {
     if (!parent::isAvailable($quote)) {
         return false;
     }
     if (!$this->_ecInstance) {
         $this->_ecInstance = $this->_paymentData->getMethodInstance(Config::METHOD_WPP_EXPRESS);
     }
     if ($quote && $this->_ecInstance) {
         $this->_ecInstance->setStore($quote->getStoreId());
     }
     return $this->_ecInstance ? !$this->_ecInstance->isAvailable() : false;
 }
 /**
  * EC PE won't be available if the EC is available
  *
  * @param \Magento\Quote\Api\Data\CartInterface|\Magento\Quote\Model\Quote|null $quote
  * @return bool
  */
 public function isAvailable(\Magento\Quote\Api\Data\CartInterface $quote = null)
 {
     if (!parent::isAvailable($quote)) {
         return false;
     }
     if (!$this->_ecInstance) {
         $this->_ecInstance = $this->_paymentData->getMethodInstance(Config::METHOD_WPP_EXPRESS);
     }
     if ($quote) {
         $this->_ecInstance->setStore($quote->getStoreId());
     }
     return !$this->_ecInstance->isAvailable();
 }