diff --git a/Block/Adminhtml/Order/Create/Installation.php b/Block/Adminhtml/Order/Create/Installation.php index e88e6f54..ee846c26 100644 --- a/Block/Adminhtml/Order/Create/Installation.php +++ b/Block/Adminhtml/Order/Create/Installation.php @@ -12,12 +12,32 @@ namespace Extend\Warranty\Block\Adminhtml\Order\Create; use Magento\Backend\Block\Template; -use Magento\Directory\Helper\Data as DirectoryHelper; -use Magento\Framework\Json\Helper\Data as JsonHelper; class Installation extends Template { - public function getCurrentStore(){ - return $this->getRequest()->getPost('store_id'); + /** + * @var \Magento\Backend\Model\Session\Quote + */ + + private $quote; + + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Backend\Model\Session\Quote $quote = null, + array $data = [] + ){ + $this->quote = $quote ?? \Magento\Framework\App\ObjectManager::getInstance() + ->get(\Magento\Backend\Model\Session\Quote::class); + parent::__construct($context, $data); + } + + /** + * Get store ID from the admin session quote (current order being created). + * + * @return int|null + */ + public function getCurrentStore() + { + return $this->quote->getStoreId(); } } \ No newline at end of file