/** * Check is link shareable or not * * @param \Magento\Downloadable\Model\Link|Item $link * @return bool */ public function getIsShareable($link) { $shareable = false; switch ($link->getIsShareable()) { case \Magento\Downloadable\Model\Link::LINK_SHAREABLE_YES: case \Magento\Downloadable\Model\Link::LINK_SHAREABLE_NO: $shareable = (bool) $link->getIsShareable(); break; case \Magento\Downloadable\Model\Link::LINK_SHAREABLE_CONFIG: $shareable = (bool) $this->_scopeConfig->isSetFlag(\Magento\Downloadable\Model\Link::XML_PATH_CONFIG_IS_SHAREABLE, \Magento\Store\Model\ScopeInterface::SCOPE_STORE); } return $shareable; }