for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Copyright © 2021 O2TI. All rights reserved.
*
* @author Bruno Elisei <[email protected]>
* See LICENSE.txt for license details.
*/
namespace O2TI\ThemeFullCheckout\Plugin;
* Class Success - Checkout Page Success.
class Success
{
* @var \Magento\Framework\Registry
protected $_coreRegistry;
* @var \Magento\Checkout\Model\Session
protected $_checkoutSession;
* Success constructor.
* @param \Magento\Framework\Registry $coreRegistry
* @param \Magento\Checkout\Model\Session $checkoutSession
public function __construct(
\Magento\Framework\Registry $coreRegistry,
\Magento\Checkout\Model\Session $checkoutSession
) {
$this->_coreRegistry = $coreRegistry;
$this->_checkoutSession = $checkoutSession;
}
* Set Current Order.
* @param \Magento\Checkout\Controller\Onepage\Success $subject
* @return void
public function beforeExecute()
$currentOrder = $this->_checkoutSession->getLastRealOrder();
$this->_coreRegistry->register('current_order', $currentOrder);
Magento\Framework\Registry::register()
If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated annotation
ignore-deprecated
/** @scrutinizer ignore-deprecated */ $this->_coreRegistry->register('current_order', $currentOrder);
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.
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.