mirror of
https://github.com/bdnugget/magento2.git
synced 2026-11-07 09:17:35 +00:00
40 lines
1.0 KiB
PHP
40 lines
1.0 KiB
PHP
<?php
|
|
/**
|
|
* Copyright © Magento, Inc. All rights reserved.
|
|
* See COPYING.txt for license details.
|
|
*/
|
|
namespace Magento\Checkout\Block;
|
|
|
|
class Success extends \Magento\Framework\View\Element\Template
|
|
{
|
|
/**
|
|
* @var \Magento\Sales\Model\OrderFactory
|
|
*/
|
|
protected $_orderFactory;
|
|
|
|
/**
|
|
* @param \Magento\Framework\View\Element\Template\Context $context
|
|
* @param \Magento\Sales\Model\OrderFactory $orderFactory
|
|
* @param array $data
|
|
* @codeCoverageIgnore
|
|
*/
|
|
public function __construct(
|
|
\Magento\Framework\View\Element\Template\Context $context,
|
|
\Magento\Sales\Model\OrderFactory $orderFactory,
|
|
array $data = []
|
|
) {
|
|
$this->_orderFactory = $orderFactory;
|
|
parent::__construct($context, $data);
|
|
}
|
|
|
|
/**
|
|
* @return int
|
|
*/
|
|
public function getRealOrderId()
|
|
{
|
|
/** @var \Magento\Sales\Model\Order $order */
|
|
$order = $this->_orderFactory->create()->load($this->getLastOrderId());
|
|
return $order->getIncrementId();
|
|
}
|
|
}
|