Your IP : 216.73.216.43


Current Path : /home/rtorresani/www/app/code/Torresani/SiWeGO/Block/Onepage/
Upload File :
Current File : //home/rtorresani/www/app/code/Torresani/SiWeGO/Block/Onepage/SiWeGOSuccess.php

<?php
namespace Torresani\SiWeGO\Block\Onepage;

class SiWeGOSuccess extends \Magento\Checkout\Block\Onepage\Success
{

    protected $orderItemsDetails;

    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magento\Checkout\Model\Session $checkoutSession,
        \Magento\Sales\Model\Order\Config $orderConfig,
        \Magento\Framework\App\Http\Context $httpContext,
        \Magento\Sales\Model\Order $orderItemsDetails,
        array $data = []
    ) {
        parent::__construct($context, $checkoutSession, $orderConfig, $httpContext, $data);
        $this->orderItemsDetails = $orderItemsDetails;
    }

    public function getOrderItemsDetails()
    {
        $IncrementId  = $this->_checkoutSession->getLastRealOrder()->getIncrementId();
        $order = $this->orderItemsDetails->loadByIncrementId($IncrementId);
        return $order;
    }
}