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
Email
Items
DefaultItems.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Sales\Block\Order\Email\Items
;
7
8
use
Magento\Sales\Model\Order\Creditmemo\Item
as
CreditmemoItem
;
9
use
Magento\Sales\Model\Order\Invoice\Item
as InvoiceItem;
10
use
Magento\Sales\Model\Order\Item
as OrderItem;
11
19
class
DefaultItems
extends
\Magento\Framework\View\Element\Template
20
{
26
public
function
getOrder
()
27
{
28
return
$this->getItem()->getOrder();
29
}
30
34
public
function
getItemOptions
()
35
{
36
$result
= [];
37
if
(
$options
= $this->getItem()->getOrderItem()->getProductOptions()) {
38
if
(isset(
$options
[
'options'
])) {
39
$result
= array_merge(
$result
,
$options
[
'options'
]);
40
}
41
if
(isset(
$options
[
'additional_options'
])) {
42
$result
= array_merge(
$result
,
$options
[
'additional_options'
]);
43
}
44
if
(isset(
$options
[
'attributes_info'
])) {
45
$result
= array_merge(
$result
,
$options
[
'attributes_info'
]);
46
}
47
}
48
49
return
$result
;
50
}
51
56
public
function
getValueHtml
(
$value
)
57
{
58
if
(is_array(
$value
)) {
59
return
sprintf(
60
'%d'
,
61
$value
[
'qty'
]
62
) .
' x '
. $this->
escapeHtml
(
63
$value
[
'title'
]
64
) .
" "
. $this->getItem()->getOrder()->formatPrice(
65
$value
[
'price'
]
66
);
67
}
else
{
68
return
$this->
escapeHtml
(
$value
);
69
}
70
}
71
76
public
function
getSku
(
$item
)
77
{
78
if
(
$item
->getOrderItem()->getProductOptionByCode(
'simple_sku'
)) {
79
return
$item
->getOrderItem()->getProductOptionByCode(
'simple_sku'
);
80
}
else
{
81
return
$item
->getSku();
82
}
83
}
84
90
public
function
getProductAdditionalInformationBlock
()
91
{
92
return
$this->
getLayout
()->getBlock(
'additional.product.info'
);
93
}
94
101
public
function
getItemPrice
(
$item
)
102
{
103
$block
= $this->
getLayout
()->getBlock(
'item_price'
);
104
$block
->setItem(
$item
);
105
return
$block
->toHtml();
106
}
107
}
$result
$result
Definition:
product_configurable_not_available_rollback.php:26
Magento\Sales\Block\Order\Email\Items\DefaultItems\getItemPrice
getItemPrice($item)
Definition:
DefaultItems.php:101
$item
$item
Definition:
partial_invoice.php:27
$block
$block
Definition:
block.php:8
Magento\Sales\Block\Order\Email\Items\DefaultItems\getValueHtml
getValueHtml($value)
Definition:
DefaultItems.php:56
Magento\Framework\View\Element\AbstractBlock\escapeHtml
escapeHtml($data, $allowedTags=null)
Definition:
AbstractBlock.php:890
$value
$value
Definition:
gender.phtml:16
Magento\Framework\View\Element\AbstractBlock\getLayout
getLayout()
Definition:
AbstractBlock.php:295
Magento\Sales\Model\Order\Invoice\Item
Definition:
Item.php:36
Magento\Sales\Model\Order\Item
Definition:
Item.php:25
Magento\Sales\Block\Order\Email\Items\DefaultItems\getProductAdditionalInformationBlock
getProductAdditionalInformationBlock()
Definition:
DefaultItems.php:90
Magento\Framework\View\Element\Template
Definition:
Template.php:32
Magento\Sales\Block\Order\Email\Items\DefaultItems\getSku
getSku($item)
Definition:
DefaultItems.php:76
Magento\Sales\Block\Order\Email\Items
Definition:
DefaultItems.php:6
Magento\Sales\Block\Order\Email\Items\DefaultItems
Definition:
DefaultItems.php:19
Magento\Sales\Block\Order\Email\Items\DefaultItems\getOrder
getOrder()
Definition:
DefaultItems.php:26
$options
$options
Definition:
multiple_mixed_products.php:29
Magento\Sales\Block\Order\Email\Items\DefaultItems\getItemOptions
getItemOptions()
Definition:
DefaultItems.php:34
Magento\Sales\Model\Order\Creditmemo\Item