@@ -38,61 +38,60 @@ $_helper = $this->helper('Magento\Catalog\Helper\Output');
38
38
}
39
39
?>
40
40
<div class="products wrapper <?= /* @escapeNotVerified */ $ viewMode ?> ">
41
- <?php $ iterator = 1 ; ?>
42
41
<ol class="products list items">
43
42
<?php foreach ($ _productCollection as $ _product ): ?>
44
- <?= /* @escapeNotVerified */ ( $ iterator ++ == 1 ) ? ' <li class="item product"> ' : ' </li><li class="item product"> ' ? >
45
- <div class="product">
46
- <?php // Product Image ?>
47
- <a href="<?= /* @escapeNotVerified */ $ _product ->getProductUrl () ?> " class="product photo">
48
- <?= $ block ->getImage ($ _product , $ image )->toHtml () ?>
49
- </a>
50
- <div class="product details">
51
- <?php
43
+ <li class="item product">
44
+ <div class="product">
45
+ <?php // Product Image ?>
46
+ <a href="<?= /* @escapeNotVerified */ $ _product ->getProductUrl () ?> " class="product photo">
47
+ <?= $ block ->getImage ($ _product , $ image )->toHtml () ?>
48
+ </a>
49
+ <div class="product details">
50
+ <?php
52
51
53
- $ info = [];
54
- $ info ['name ' ] = '<strong class="product name"> '
55
- . ' <a href=" ' . $ _product ->getProductUrl () . '" title=" '
56
- . $ block ->stripTags ($ _product ->getName (), null , true ) . '"> '
57
- . $ _helper ->productAttribute ($ _product , $ _product ->getName (), 'name ' )
58
- . '</a></strong> ' ;
59
- $ info ['price ' ] = $ block ->getProductPrice ($ _product );
60
- $ info ['review ' ] = $ block ->getReviewsSummaryHtml ($ _product , $ templateType );
52
+ $ info = [];
53
+ $ info ['name ' ] = '<strong class="product name"> '
54
+ . ' <a href=" ' . $ _product ->getProductUrl () . '" title=" '
55
+ . $ block ->stripTags ($ _product ->getName (), null , true ) . '"> '
56
+ . $ _helper ->productAttribute ($ _product , $ _product ->getName (), 'name ' )
57
+ . '</a></strong> ' ;
58
+ $ info ['price ' ] = $ block ->getProductPrice ($ _product );
59
+ $ info ['review ' ] = $ block ->getReviewsSummaryHtml ($ _product , $ templateType );
61
60
62
- if ($ _product ->isSaleable ()) {
63
- $ info ['button ' ] = '<button type="button" title=" ' . __ ('Add to Cart ' ) . '" class="action tocart" '
64
- . ' data-mage-init= \'{ "redirectUrl": { "event": "click", url: " ' . $ block ->getAddToCartUrl ($ _product ) . '"} } \'> '
65
- . '<span> ' . __ ('Add to Cart ' ) . '</span></button> ' ;
66
- } else {
67
- $ info ['button ' ] = $ _product ->getIsSalable () ? '<div class="stock available"><span> ' . __ ('In stock ' ) . '</span></div> ' :
68
- '<div class="stock unavailable"><span> ' . __ ('Out of stock ' ) . '</span></div> ' ;
69
- }
61
+ if ($ _product ->isSaleable ()) {
62
+ $ info ['button ' ] = '<button type="button" title=" ' . __ ('Add to Cart ' ) . '" class="action tocart" '
63
+ . ' data-mage-init= \'{ "redirectUrl": { "event": "click", url: " ' . $ block ->getAddToCartUrl ($ _product ) . '"} } \'> '
64
+ . '<span> ' . __ ('Add to Cart ' ) . '</span></button> ' ;
65
+ } else {
66
+ $ info ['button ' ] = $ _product ->getIsSalable () ? '<div class="stock available"><span> ' . __ ('In stock ' ) . '</span></div> ' :
67
+ '<div class="stock unavailable"><span> ' . __ ('Out of stock ' ) . '</span></div> ' ;
68
+ }
70
69
71
- $ info ['links ' ] = '<div class="product links" data-role="add-to-links"> '
72
- . '<a href="#" data-post= \'' . $ this ->helper ('Magento\Wishlist\Helper\Data ' )->getAddParams ($ _product ) . '\' class="action towishlist" data-action="add-to-wishlist"> '
73
- . '<span> ' . __ ('Add to Wish List ' ) . '</span></a> '
74
- . '<a href=" ' . $ block ->getAddToCompareUrl ($ _product ) . '" class="action tocompare"> '
75
- . '<span> ' . __ ('Add to Compare ' ) . '</span></a></div> ' ;
76
- $ info ['actions ' ] = '<div class="product action"> ' . $ info ['button ' ] . $ info ['links ' ] . '</div> ' ;
70
+ $ info ['links ' ] = '<div class="product links" data-role="add-to-links"> '
71
+ . '<a href="#" data-post= \'' . $ this ->helper ('Magento\Wishlist\Helper\Data ' )->getAddParams ($ _product ) . '\' class="action towishlist" data-action="add-to-wishlist"> '
72
+ . '<span> ' . __ ('Add to Wish List ' ) . '</span></a> '
73
+ . '<a href=" ' . $ block ->getAddToCompareUrl ($ _product ) . '" class="action tocompare"> '
74
+ . '<span> ' . __ ('Add to Compare ' ) . '</span></a></div> ' ;
75
+ $ info ['actions ' ] = '<div class="product action"> ' . $ info ['button ' ] . $ info ['links ' ] . '</div> ' ;
77
76
78
- if ($ showDescription ) {
79
- $ info ['description ' ] = '<div class="product description"> '
80
- . $ _helper ->productAttribute ($ _product , $ _product ->getShortDescription (), 'short_description ' )
81
- . ' <a href=" ' . $ _product ->getProductUrl () . '" class="action more"> '
82
- . __ ('Learn More ' ) . '</a></div> ' ;
83
- } else {
84
- $ info ['description ' ] = '' ;
85
- }
77
+ if ($ showDescription ) {
78
+ $ info ['description ' ] = '<div class="product description"> '
79
+ . $ _helper ->productAttribute ($ _product , $ _product ->getShortDescription (), 'short_description ' )
80
+ . ' <a href=" ' . $ _product ->getProductUrl () . '" class="action more"> '
81
+ . __ ('Learn More ' ) . '</a></div> ' ;
82
+ } else {
83
+ $ info ['description ' ] = '' ;
84
+ }
86
85
87
- $ details = $ block ->getInfoOrder () ?: ['name ' ,'price ' ,'review ' ,'description ' ,'actions ' ];
88
- foreach ($ details as $ detail ) {
89
- /* @escapeNotVerified */ echo $ info [$ detail ];
90
- }
91
- ?>
86
+ $ details = $ block ->getInfoOrder () ?: ['name ' ,'price ' ,'review ' ,'description ' ,'actions ' ];
87
+ foreach ($ details as $ detail ) {
88
+ /* @escapeNotVerified */ echo $ info [$ detail ];
89
+ }
90
+ ?>
92
91
92
+ </div>
93
93
</div>
94
- </div>
95
- <?= ($ iterator == count ($ _productCollection )+1 ) ? '</li> ' : '' ?>
94
+ </li>
96
95
<?php endforeach ; ?>
97
96
</ol>
98
97
</div>
0 commit comments