Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-sales
Block
Order
Invoice
Totals.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Sales\Block\Order\Invoice
;
7
8
use
Magento\Sales\Model\Order
;
9
14
class
Totals
extends
\Magento\Sales\Block\Order\Totals
15
{
21
public
function
__construct
(
22
\
Magento
\Framework\
View
\Element\Template\
Context
$context,
23
\
Magento
\Framework\
Registry
$registry
,
24
array
$data
= []
25
) {
26
parent::__construct($context,
$registry
,
$data
);
27
$this->_isScopePrivate =
true
;
28
}
29
33
protected
$_invoice
=
null
;
34
38
public
function
getInvoice
()
39
{
40
if
($this->_invoice ===
null
) {
41
if
($this->
hasData
(
'invoice'
)) {
42
$this->_invoice = $this->
_getData
(
'invoice'
);
43
}
elseif
($this->_coreRegistry->registry(
'current_invoice'
)) {
44
$this->_invoice = $this->_coreRegistry->registry(
'current_invoice'
);
45
}
elseif
($this->
getParentBlock
()->
getInvoice
()) {
46
$this->_invoice = $this->
getParentBlock
()->getInvoice();
47
}
48
}
49
return
$this->_invoice
;
50
}
51
56
public
function
setInvoice
(
$invoice
)
57
{
58
$this->_invoice =
$invoice
;
59
return
$this;
60
}
61
67
public
function
getSource
()
68
{
69
return
$this->
getInvoice
();
70
}
71
77
protected
function
_initTotals
()
78
{
79
parent::_initTotals();
80
$this->
removeTotal
(
'base_grandtotal'
);
81
return
$this;
82
}
83
}
Magento\Framework\View\Element\AbstractBlock\getParentBlock
getParentBlock()
Definition:
AbstractBlock.php:251
Magento\Sales\Block\Order\Invoice\Totals\$_invoice
$_invoice
Definition:
Totals.php:33
elseif
elseif(isset( $params[ 'redirect_parent']))
Definition:
iframe.phtml:17
Magento\Sales\Model\Order
Magento\Sales\Block\Order\Invoice
Definition:
ItemsTest.php:6
Magento\Framework\DataObject\_getData
_getData($key)
Definition:
DataObject.php:189
Magento\Framework\DataObject\hasData
hasData($key='')
Definition:
DataObject.php:231
Magento\Sales\Block\Order\Invoice\Totals\setInvoice
setInvoice($invoice)
Definition:
Totals.php:56
$registry
$registry
Definition:
bundle_product_with_not_visible_children_rollback.php:16
Magento\Framework\View\Element\Template\Context
Definition:
Context.php:23
Magento\Sales\Block\Order\Invoice\Totals\__construct
__construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\Registry $registry, array $data=[])
Definition:
Totals.php:21
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Sales\Block\Order\Invoice\Totals\_initTotals
_initTotals()
Definition:
Totals.php:77
Magento\Sales\Block\Order\Totals\removeTotal
removeTotal($code)
Definition:
Totals.php:276
$invoice
$invoice
Definition:
partial_invoice.php:22
Magento\Sales\Block\Order\Invoice\Totals\getSource
getSource()
Definition:
Totals.php:67
Magento\Sales\Block\Order\Invoice\Totals\getInvoice
getInvoice()
Definition:
Totals.php:38
Magento
Magento\Sales\Block\Order\View
Definition:
View.php:16
Magento\Framework\Registry
Definition:
Registry.php:18
Magento\Sales\Block\Order\Totals
Definition:
Totals.php:14
Magento\Sales\Block\Order\Invoice\Totals
Definition:
Totals.php:14