Skip to content

Commit 468c0b4

Browse files
author
Yurii Torbyk
committed
MAGETWO-33058: Refactor Checkout module
1 parent b81ad3f commit 468c0b4

File tree

2 files changed

+79
-2
lines changed

2 files changed

+79
-2
lines changed

app/code/Magento/Checkout/Controller/Cart/Configure.php

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,47 @@
66
*/
77
namespace Magento\Checkout\Controller\Cart;
88

9-
class Configure extends \Magento\Checkout\Controller\Cart\Index
9+
use Magento\Framework;
10+
11+
class Configure extends \Magento\Checkout\Controller\Cart
1012
{
13+
/**
14+
* @var \Magento\Framework\View\Result\PageFactory
15+
*/
16+
protected $resultPageFactory;
17+
18+
/**
19+
* @param \Magento\Framework\App\Action\Context $context
20+
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
21+
* @param \Magento\Checkout\Model\Session $checkoutSession
22+
* @param \Magento\Framework\Store\StoreManagerInterface $storeManager
23+
* @param \Magento\Core\App\Action\FormKeyValidator $formKeyValidator
24+
* @param \Magento\Checkout\Model\Cart $cart
25+
* @param \Magento\Framework\Controller\Result\RedirectFactory $resultRedirectFactory
26+
* @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
27+
*/
28+
public function __construct(
29+
Framework\App\Action\Context $context,
30+
Framework\App\Config\ScopeConfigInterface $scopeConfig,
31+
\Magento\Checkout\Model\Session $checkoutSession,
32+
Framework\Store\StoreManagerInterface $storeManager,
33+
\Magento\Core\App\Action\FormKeyValidator $formKeyValidator,
34+
\Magento\Checkout\Model\Cart $cart,
35+
Framework\Controller\Result\RedirectFactory $resultRedirectFactory,
36+
Framework\View\Result\PageFactory $resultPageFactory
37+
) {
38+
parent::__construct(
39+
$context,
40+
$scopeConfig,
41+
$checkoutSession,
42+
$storeManager,
43+
$formKeyValidator,
44+
$cart,
45+
$resultRedirectFactory
46+
);
47+
$this->resultPageFactory = $resultPageFactory;
48+
}
49+
1150
/**
1251
* Action to reconfigure cart item
1352
*

app/code/Magento/Checkout/Controller/Cart/EstimatePost.php

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,48 @@
55
*/
66
namespace Magento\Checkout\Controller\Cart;
77

8+
use Magento\Framework;
89
use Magento\Checkout\Model\Cart as CustomerCart;
910

10-
class EstimatePost extends \Magento\Checkout\Controller\Cart\CouponPost
11+
class EstimatePost extends \Magento\Checkout\Controller\Cart
1112
{
13+
/**
14+
* @var \Magento\Quote\Model\QuoteRepository
15+
*/
16+
protected $quoteRepository;
17+
18+
/**
19+
* @param \Magento\Framework\App\Action\Context $context
20+
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
21+
* @param \Magento\Checkout\Model\Session $checkoutSession
22+
* @param \Magento\Framework\Store\StoreManagerInterface $storeManager
23+
* @param \Magento\Core\App\Action\FormKeyValidator $formKeyValidator
24+
* @param CustomerCart $cart
25+
* @param \Magento\Framework\Controller\Result\RedirectFactory $resultRedirectFactory
26+
* @param \Magento\Quote\Model\QuoteRepository $quoteRepository
27+
*/
28+
public function __construct(
29+
Framework\App\Action\Context $context,
30+
Framework\App\Config\ScopeConfigInterface $scopeConfig,
31+
\Magento\Checkout\Model\Session $checkoutSession,
32+
Framework\Store\StoreManagerInterface $storeManager,
33+
\Magento\Core\App\Action\FormKeyValidator $formKeyValidator,
34+
CustomerCart $cart,
35+
Framework\Controller\Result\RedirectFactory $resultRedirectFactory,
36+
\Magento\Quote\Model\QuoteRepository $quoteRepository
37+
) {
38+
$this->quoteRepository = $quoteRepository;
39+
parent::__construct(
40+
$context,
41+
$scopeConfig,
42+
$checkoutSession,
43+
$storeManager,
44+
$formKeyValidator,
45+
$cart,
46+
$resultRedirectFactory
47+
);
48+
}
49+
1250
/**
1351
* Initialize shipping information
1452
*

0 commit comments

Comments
 (0)