@@ -17,7 +17,7 @@ use Magento\Framework\App\Action\Action;
17
17
* @var \Magento\Framework\Escaper $escaper
18
18
*/
19
19
?>
20
- <?php if ($ exist = ($ block ->getProductCollection () && $ block ->getProductCollection ()->getSize ())) : ?>
20
+ <?php if ($ exist = ($ block ->getProductCollection () && $ block ->getProductCollection ()->getSize ())): ?>
21
21
<?php
22
22
$ type = 'widget-product-carousel ' ;
23
23
@@ -31,7 +31,7 @@ use Magento\Framework\App\Action\Action;
31
31
?>
32
32
<ol class="product-items <?= /* @noEscape */ $ type ?> ">
33
33
<?php $ iterator = 1 ; ?>
34
- <?php foreach ($ items as $ _item ) : ?>
34
+ <?php foreach ($ items as $ _item ): ?>
35
35
<?= /* @noEscape */ ($ iterator ++ == 1 ) ? '<li class="product-item"> ' : '</li><li class="product-item"> ' ?>
36
36
<div class="product-item-info">
37
37
<a href="<?= $ block ->escapeUrl ($ block ->getProductUrl ($ _item )) ?> " class="product-item-photo">
@@ -45,20 +45,20 @@ use Magento\Framework\App\Action\Action;
45
45
<?= $ block ->escapeHtml ($ _item ->getName ()) ?>
46
46
</a>
47
47
</strong>
48
- <?php if ($ templateType ) : ?>
48
+ <?php if ($ templateType ): ?>
49
49
<?= $ block ->getReviewsSummaryHtml ($ _item , $ templateType ) ?>
50
50
<?php endif ; ?>
51
51
52
52
<?= $ block ->getProductPriceHtml ($ _item , $ type ) ?>
53
53
54
54
<?= $ block ->getProductDetailsHtml ($ _item ) ?>
55
55
56
- <?php if ($ showWishlist || $ showCompare || $ showCart ) : ?>
56
+ <?php if ($ showWishlist || $ showCompare || $ showCart ): ?>
57
57
<div class="product-item-inner">
58
58
<div class="product-item-actions">
59
- <?php if ($ showCart ) : ?>
59
+ <?php if ($ showCart ): ?>
60
60
<div class="actions-primary">
61
- <?php if ($ _item ->isSaleable ()) : ?>
61
+ <?php if ($ _item ->isSaleable ()): ?>
62
62
<?php $ postParams = $ block ->getAddToCartPostParams ($ _item ); ?>
63
63
<form data-role="tocart-form" data-product-sku="<?= $ block ->escapeHtml ($ _item ->getSku ()) ?> " action="<?= $ block ->escapeUrl ($ postParams ['action ' ]) ?> " method="post">
64
64
<input type="hidden" name="product" value="<?= $ block ->escapeHtmlAttr ($ postParams ['data ' ]['product ' ]) ?> ">
@@ -70,33 +70,33 @@ use Magento\Framework\App\Action\Action;
70
70
<span><?= $ block ->escapeHtml (__ ('Add to Cart ' )) ?> </span>
71
71
</button>
72
72
</form>
73
- <?php else : ?>
74
- <?php if ($ _item ->getIsSalable ()) : ?>
73
+ <script type="text/x-magento-init">
74
+ {
75
+ "[data-role=tocart-form], .form.map.checkout": {
76
+ "catalogAddToCart": {
77
+ "product_sku": "<?= $ escaper ->escapeJs ($ _item ->getSku ()); ?> "
78
+ }
79
+ }
80
+ }
81
+ </script>
82
+ <?php else : ?>
83
+ <?php if ($ _item ->getIsSalable ()): ?>
75
84
<div class="stock available"><span><?= $ block ->escapeHtml (__ ('In stock ' )) ?> </span></div>
76
- <?php else : ?>
85
+ <?php else : ?>
77
86
<div class="stock unavailable"><span><?= $ block ->escapeHtml (__ ('Out of stock ' )) ?> </span></div>
78
87
<?php endif ; ?>
79
88
<?php endif ; ?>
80
89
</div>
81
- <script type="text/x-magento-init">
82
- {
83
- "[data-role=tocart-form], .form.map.checkout": {
84
- "catalogAddToCart": {
85
- "product_sku": "<?= $ escaper ->escapeJs ($ _item ->getSku ()); ?> "
86
- }
87
- }
88
- }
89
- </script>
90
90
<?php endif ; ?>
91
- <?php if ($ showWishlist || $ showCompare ) : ?>
91
+ <?php if ($ showWishlist || $ showCompare ): ?>
92
92
<div class="actions-secondary" data-role="add-to-links">
93
- <?php if ($ this ->helper (\Magento \Wishlist \Helper \Data::class)->isAllow () && $ showWishlist ) : ?>
93
+ <?php if ($ this ->helper (\Magento \Wishlist \Helper \Data::class)->isAllow () && $ showWishlist ): ?>
94
94
<a href="#"
95
95
data-post='<?= /* @noEscape */ $ block ->getAddToWishlistParams ($ _item ) ?> ' class="action towishlist" data-action="add-to-wishlist" title="<?= $ block ->escapeHtmlAttr (__ ('Add to Wish List ' )) ?> ">
96
96
<span><?= $ block ->escapeHtml (__ ('Add to Wish List ' )) ?> </span>
97
97
</a>
98
98
<?php endif ; ?>
99
- <?php if ($ block ->getAddToCompareUrl () && $ showCompare ) : ?>
99
+ <?php if ($ block ->getAddToCompareUrl () && $ showCompare ): ?>
100
100
<?php $ compareHelper = $ this ->helper (\Magento \Catalog \Helper \Product \Compare::class);?>
101
101
<a href="#" class="action tocompare" data-post='<?= /* @noEscape */ $ compareHelper ->getPostDataParams ($ _item ) ?> ' title="<?= $ block ->escapeHtmlAttr (__ ('Add to Compare ' )) ?> ">
102
102
<span><?= $ block ->escapeHtml (__ ('Add to Compare ' )) ?> </span>
0 commit comments