Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Link.php
Go to the documentation of this file.
1 <?php
7 
16 {
20  protected $_checkoutSession;
21 
25  protected $_checkoutHelper;
26 
33  public function __construct(
34  \Magento\Framework\View\Element\Template\Context $context,
35  \Magento\Checkout\Model\Session $checkoutSession,
36  \Magento\Checkout\Helper\Data $checkoutHelper,
37  array $data = []
38  ) {
39  $this->_checkoutHelper = $checkoutHelper;
40  $this->_checkoutSession = $checkoutSession;
41  parent::__construct($context, $data);
42  $this->_isScopePrivate = true;
43  }
44 
48  public function getCheckoutUrl()
49  {
50  return $this->getUrl('checkout');
51  }
52 
56  public function isDisabled()
57  {
58  return !$this->_checkoutSession->getQuote()->validateMinimumAmount();
59  }
60 
64  public function isPossibleOnepageCheckout()
65  {
66  return $this->_checkoutHelper->canOnepageCheckout();
67  }
68 }