1 | <?php |
||
2 | /** |
||
3 | * Copyright © 2021 O2TI. All rights reserved. |
||
4 | * |
||
5 | * @author Bruno Elisei <[email protected]> |
||
6 | * See LICENSE.txt for license details. |
||
7 | */ |
||
8 | |||
9 | namespace O2TI\ThemeFullCheckout\Plugin; |
||
10 | |||
11 | /** |
||
12 | * Class Success - Checkout Page Success. |
||
13 | */ |
||
14 | class Success |
||
15 | { |
||
16 | /** |
||
17 | * @var \Magento\Framework\Registry |
||
18 | */ |
||
19 | protected $_coreRegistry; |
||
20 | /** |
||
21 | * @var \Magento\Checkout\Model\Session |
||
22 | */ |
||
23 | protected $_checkoutSession; |
||
24 | |||
25 | /** |
||
26 | * Success constructor. |
||
27 | * |
||
28 | * @param \Magento\Framework\Registry $coreRegistry |
||
29 | * @param \Magento\Checkout\Model\Session $checkoutSession |
||
30 | */ |
||
31 | public function __construct( |
||
32 | \Magento\Framework\Registry $coreRegistry, |
||
33 | \Magento\Checkout\Model\Session $checkoutSession |
||
34 | ) { |
||
35 | $this->_coreRegistry = $coreRegistry; |
||
36 | $this->_checkoutSession = $checkoutSession; |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * Set Current Order. |
||
41 | * |
||
42 | * @param \Magento\Checkout\Controller\Onepage\Success $subject |
||
43 | * |
||
44 | * @return void |
||
45 | */ |
||
46 | public function beforeExecute() |
||
47 | { |
||
48 | $currentOrder = $this->_checkoutSession->getLastRealOrder(); |
||
49 | $this->_coreRegistry->register('current_order', $currentOrder); |
||
0 ignored issues
–
show
|
|||
50 | } |
||
51 | } |
||
52 |
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.