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-catalog
view
frontend
templates
product
view
attribute.phtml
Go to the documentation of this file.
1
<?php
7
// @codingStandardsIgnoreFile
8
14
?>
15
<?php
16
$_helper
= $this->helper(
'Magento\Catalog\Helper\Output'
);
17
$_product
=
$block
->getProduct();
18
$_call
=
$block
->getAtCall();
19
$_code
=
$block
->getAtCode();
20
$_className
=
$block
->getCssClass();
21
$_attributeLabel
=
$block
->getAtLabel();
22
$_attributeType
=
$block
->getAtType();
23
$_attributeAddAttribute
=
$block
->getAddAttribute();
24
25
$renderLabel
=
true
;
26
// if defined as 'none' in layout, do not render
27
if
(
$_attributeLabel
==
'none'
) {
28
$renderLabel
=
false
;
29
}
30
31
if
(
$_attributeLabel
&&
$_attributeLabel
==
'default'
) {
32
$_attributeLabel
=
$_product
->getResource()->getAttribute(
$_code
)->getStoreLabel();
33
}
34
if
(
$_attributeType
&&
$_attributeType
==
'text'
) {
35
$_attributeValue = (
$_helper
->productAttribute(
$_product
,
$_product
->$_call(),
$_code
)) ?
$_product
->getAttributeText(
$_code
) :
''
;
36
}
else
{
37
$_attributeValue =
$_helper
->productAttribute(
$_product
,
$_product
->$_call(),
$_code
);
38
}
39
?>
40
41
<?php
if
($_attributeValue): ?>
42
<div
class
=
"product attribute <?= /* @escapeNotVerified */ $_className ?>"
>
43
<?php
if
(
$renderLabel
): ?><strong
class
=
"type"
><?=
/* @escapeNotVerified */
$_attributeLabel
?></strong><?php
endif
; ?>
44
<div
class
=
"value"
<?=
/* @escapeNotVerified */
$_attributeAddAttribute
?>><?=
/* @escapeNotVerified */
$_attributeValue ?></div>
45
</div>
46
<?php
endif
; ?>
endif
if( $_attributeValue)($renderLabel) endif
Definition:
attribute.phtml:44
$_product
$_product
Definition:
attribute.phtml:17
$_code
$_code
Definition:
attribute.phtml:19
$block
$block
Definition:
block.php:8
$_className
$_className
Definition:
attribute.phtml:20
$_attributeType
$_attributeType
Definition:
attribute.phtml:22
$_call
$_call
Definition:
attribute.phtml:18
$renderLabel
$renderLabel
Definition:
attribute.phtml:25
$_attributeAddAttribute
$_attributeAddAttribute
Definition:
attribute.phtml:23
$_helper
$_helper
Definition:
attribute.phtml:16
$_attributeLabel
$_attributeLabel
Definition:
attribute.phtml:21