11 use Magento\Paypal\Model\ConfigFactory;
36 private $isMiniCart =
false;
41 private $localeResolver;
74 parent::__construct($context,
$data);
76 $this->localeResolver = $localeResolver;
88 private function isInContext()
90 return (
bool)(int) $this->config->getValue(
'in_context');
98 private function isVisibleOnCart()
100 return (
bool)(int) $this->config->getValue(
'visible_on_cart');
111 return $this->payment->isAvailable($this->session->getQuote())
113 && $this->isInContext()
114 && $this->isVisibleOnCart();
126 return parent::_toHtml();
134 return $this->
getData(self::BUTTON_ELEMENT_INDEX);
142 return $this->
getData(self::LINK_DATA_ACTION);
150 return $this->
getData(self::CART_BUTTON_ELEMENT_INDEX);
158 return $this->config->getExpressCheckoutInContextImageUrl(
159 $this->localeResolver->getLocale()
170 return $this->
getData(self::ALIAS_ELEMENT_INDEX);
179 $this->isMiniCart = !$isCatalog;
const ALIAS_ELEMENT_INDEX
getData($key='', $index=null)
const BUTTON_ELEMENT_INDEX
__construct(Context $context, ResolverInterface $localeResolver, ConfigFactory $configFactory, Session $session, MethodInterface $payment, array $data=[])
setIsInCatalogProduct($isCatalog)
const CART_BUTTON_ELEMENT_INDEX