32 private $itemsPerPage;
37 private $itemCollectionFactory;
42 private $itemCollection;
59 parent::__construct($context,
$data);
70 $this->itemsPerPage = $this->_scopeConfig->getValue(
'sales/orders/items_per_page');
72 $this->itemCollection = $this->itemCollectionFactory->create();
73 $this->itemCollection->setOrderFilter($this->
getOrder());
74 $this->itemCollection->filterByParent(
null);
79 $pagerBlock->setLimit($this->itemsPerPage);
81 $pagerBlock->setCollection($this->itemCollection);
82 $pagerBlock->setAvailableLimit([$this->itemsPerPage]);
86 return parent::_prepareLayout();
99 return $pagerBlock && ($this->itemCollection->getSize() > $this->itemsPerPage);
111 return $this->itemCollection->getItems();
121 public function getPagerHtml()
124 $pagerBlock = $this->
getChildBlock(
'sales_order_item_pager');
125 return $pagerBlock ? $pagerBlock->toHtml() :
'';
135 return $this->_coreRegistry->registry(
'current_order');
__construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\Registry $registry, array $data=[], \Magento\Sales\Model\ResourceModel\Order\Item\CollectionFactory $itemCollectionFactory=null)