Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions Block/Adminhtml/Order/Create/Installation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}