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
addtocart.phtml
Go to the documentation of this file.
1
<?php
7
// @codingStandardsIgnoreFile
8
10
?>
11
<?php
$_product
=
$block
->getProduct(); ?>
12
<?php
$buttonTitle
=
__
(
'Add to Cart'
); ?>
13
<?php
if
(
$_product
->isSaleable()): ?>
14
<div
class
=
"box-tocart"
>
15
<div
class
=
"fieldset"
>
16
<?php
if
(
$block
->shouldRenderQuantity()): ?>
17
<div
class
=
"field qty"
>
18
<label
class
=
"label"
for
=
"qty"
><span><?=
/* @escapeNotVerified */
__
(
'Qty'
) ?></span></label>
19
<div
class
=
"control"
>
20
<input type=
"number"
21
name
=
"qty"
22
id
=
"qty"
23
value
=
"<?= /* @escapeNotVerified */ $block->getProductDefaultQty() * 1 ?>"
24
title=
"<?= /* @escapeNotVerified */ __('Qty') ?>"
25
class
=
"input-text qty"
26
data-validate=
"<?= $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>"
27
/>
28
</div>
29
</div>
30
<?php
endif
; ?>
31
<div
class
=
"actions"
>
32
<button type=
"submit"
33
title=
"<?= /* @escapeNotVerified */ $buttonTitle ?>"
34
class
=
"action primary tocart"
35
id
=
"product-addtocart-button"
>
36
<span><?=
/* @escapeNotVerified */
$buttonTitle
?></span>
37
</button>
38
<?=
$block
->getChildHtml(
''
,
true
) ?>
39
</div>
40
</div>
41
</div>
42
<?php
endif
; ?>
43
<script type=
"text/x-magento-init"
>
44
{
45
"#product_addtocart_form"
: {
46
"Magento_Catalog/js/validate-product"
: {}
47
}
48
}
49
</script>
value
$block setTitle( 'CMS Block Title') -> setIdentifier('fixture_block') ->setContent('< h1 >Fixture Block Title</h1 >< a href=" store url</a><p> Config value
Definition:
block.php:9
$buttonTitle
$buttonTitle
Definition:
addtocart.phtml:12
__
__()
Definition:
__.php:13
$_product
$_product
Definition:
addtocart.phtml:11
$block
$block
Definition:
block.php:8
name
endif
endif
Definition:
addtocart.phtml:38