46 private $storeManager;
64 $this->_orderCollectionFactory = $orderCollectionFactory;
65 $this->_customerSession = $customerSession;
66 $this->_orderConfig = $orderConfig;
67 $this->_isScopePrivate =
true;
69 ->get(StoreManagerInterface::class);
70 parent::__construct($context,
$data);
79 $this->getRecentOrders();
86 private function getRecentOrders()
88 $orders = $this->_orderCollectionFactory->create()->addAttributeToSelect(
90 )->addAttributeToFilter(
92 $this->_customerSession->getCustomerId()
93 )->addAttributeToFilter(
95 $this->storeManager->getStore()->getId()
96 )->addAttributeToFilter(
98 [
'in' => $this->_orderConfig->getVisibleOnFrontStatuses()]
99 )->addAttributeToSort(
114 return $this->
getUrl(
'sales/order/view', [
'order_id' =>
$order->getId()]);
123 return $this->
getUrl(
'sales/order/track', [
'order_id' =>
$order->getId()]);
131 if ($this->getOrders()->getSize() > 0) {
132 return parent::_toHtml();
143 return $this->
getUrl(
'sales/order/reorder', [
'order_id' =>
$order->getId()]);
getUrl($route='', $params=[])
__construct(Context $context, CollectionFactory $orderCollectionFactory, Session $customerSession, Config $orderConfig, array $data=[], StoreManagerInterface $storeManager=null)