6
6
7
7
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
8
8
// phpcs:disable Generic.WhiteSpace.ScopeIndent.Incorrect
9
+ // phpcs:disable Generic.Files.LineLength
10
+ // phpcs:disable Magento2.Templates.ThisInTemplate.FoundHelper
9
11
10
12
/* @var $block \Magento\Catalog\Block\Product\AbstractProduct */
11
13
?>
@@ -156,39 +158,39 @@ switch ($type = $block->getType()) {
156
158
}
157
159
?>
158
160
159
- <?php if ($ exist ) :?>
161
+ <?php if ($ exist ):?>
160
162
161
- <?php if ($ type == 'related ' || $ type == 'upsell ' ) :?>
162
- <?php if ($ type == 'related ' ) :?>
163
+ <?php if ($ type == 'related ' || $ type == 'upsell ' ):?>
164
+ <?php if ($ type == 'related ' ):?>
163
165
<div class="block <?= $ block ->escapeHtmlAttr ($ class ) ?> " data-mage-init='{"relatedProducts":{"relatedCheckbox":".related.checkbox"}}' data-limit="<?= $ block ->escapeHtmlAttr ($ limit ) ?> " data-shuffle="<?= /* @noEscape */ $ shuffle ?> " data-shuffle-weighted="<?= /* @noEscape */ $ isWeightedRandom ?> ">
164
- <?php else :?>
166
+ <?php else :?>
165
167
<div class="block <?= $ block ->escapeHtmlAttr ($ class ) ?> " data-mage-init='{"upsellProducts":{}}' data-limit="<?= $ block ->escapeHtmlAttr ($ limit ) ?> " data-shuffle="<?= /* @noEscape */ $ shuffle ?> " data-shuffle-weighted="<?= /* @noEscape */ $ isWeightedRandom ?> ">
166
168
<?php endif ; ?>
167
- <?php else :?>
169
+ <?php else :?>
168
170
<div class="block <?= $ block ->escapeHtmlAttr ($ class ) ?> ">
169
171
<?php endif ; ?>
170
172
<div class="block-title title">
171
173
<strong id="block-<?= $ block ->escapeHtmlAttr ($ class ) ?> -heading" role="heading" aria-level="2"><?= $ block ->escapeHtml ($ title ) ?> </strong>
172
174
</div>
173
175
<div class="block-content content" aria-labelledby="block-<?= $ block ->escapeHtmlAttr ($ class ) ?> -heading">
174
- <?php if ($ type == 'related ' && $ canItemsAddToCart ) :?>
176
+ <?php if ($ type == 'related ' && $ canItemsAddToCart ):?>
175
177
<div class="block-actions">
176
178
<?= $ block ->escapeHtml (__ ('Check items to add to the cart or ' )) ?>
177
179
<button type="button" class="action select" data-role="select-all"><span><?= $ block ->escapeHtml (__ ('select all ' )) ?> </span></button>
178
180
</div>
179
181
<?php endif ; ?>
180
182
<div class="products wrapper grid products-grid products-<?= $ block ->escapeHtmlAttr ($ type ) ?> ">
181
183
<ol class="products list items product-items">
182
- <?php foreach ($ items as $ _item ) :?>
184
+ <?php foreach ($ items as $ _item ):?>
183
185
<?php $ available = '' ; ?>
184
- <?php if (!$ _item ->isComposite () && $ _item ->isSaleable () && $ type == 'related ' ) :?>
185
- <?php if (!$ _item ->getRequiredOptions ()) :?>
186
+ <?php if (!$ _item ->isComposite () && $ _item ->isSaleable () && $ type == 'related ' ):?>
187
+ <?php if (!$ _item ->getRequiredOptions ()):?>
186
188
<?php $ available = 'related-available ' ; ?>
187
189
<?php endif ; ?>
188
190
<?php endif ; ?>
189
- <?php if ($ type == 'related ' || $ type == 'upsell ' ) :?>
191
+ <?php if ($ type == 'related ' || $ type == 'upsell ' ):?>
190
192
<li class="item product product-item" style="display: none;" data-shuffle-group="<?= $ block ->escapeHtmlAttr ($ _item ->getPriority ()) ?> " >
191
- <?php else :?>
193
+ <?php else :?>
192
194
<li class="item product product-item">
193
195
<?php endif ; ?>
194
196
<div class="product-item-info <?= /* @noEscape */ $ available ?> ">
@@ -203,29 +205,29 @@ switch ($type = $block->getType()) {
203
205
204
206
<?= /* @noEscape */ $ block ->getProductPrice ($ _item ) ?>
205
207
206
- <?php if ($ templateType ) :?>
208
+ <?php if ($ templateType ):?>
207
209
<?= $ block ->getReviewsSummaryHtml ($ _item , $ templateType ) ?>
208
210
<?php endif ; ?>
209
211
210
- <?php if ($ canItemsAddToCart && !$ _item ->isComposite () && $ _item ->isSaleable () && $ type == 'related ' ) :?>
211
- <?php if (!$ _item ->getRequiredOptions ()) :?>
212
+ <?php if ($ canItemsAddToCart && !$ _item ->isComposite () && $ _item ->isSaleable () && $ type == 'related ' ):?>
213
+ <?php if (!$ _item ->getRequiredOptions ()):?>
212
214
<div class="field choice related">
213
215
<input type="checkbox" class="checkbox related" id="related-checkbox<?= $ block ->escapeHtmlAttr ($ _item ->getId ()) ?> " name="related_products[]" value="<?= $ block ->escapeHtmlAttr ($ _item ->getId ()) ?> " />
214
216
<label class="label" for="related-checkbox<?= $ block ->escapeHtmlAttr ($ _item ->getId ()) ?> "><span><?= $ block ->escapeHtml (__ ('Add to Cart ' )) ?> </span></label>
215
217
</div>
216
218
<?php endif ; ?>
217
219
<?php endif ; ?>
218
220
219
- <?php if ($ showAddTo || $ showCart ) :?>
221
+ <?php if ($ showAddTo || $ showCart ):?>
220
222
<div class="product actions product-item-actions">
221
- <?php if ($ showCart ) :?>
223
+ <?php if ($ showCart ):?>
222
224
<div class="actions-primary">
223
- <?php if ($ _item ->isSaleable ()) :?>
224
- <?php if ($ _item ->getTypeInstance ()->hasRequiredOptions ($ _item )) :?>
225
+ <?php if ($ _item ->isSaleable ()):?>
226
+ <?php if ($ _item ->getTypeInstance ()->hasRequiredOptions ($ _item )):?>
225
227
<button class="action tocart primary" data-mage-init='{"redirectUrl": {"url": "<?= $ block ->escapeUrl ($ block ->getAddToCartUrl ($ _item )) ?> "}}' type="button" title="<?= $ block ->escapeHtmlAttr (__ ('Add to Cart ' )) ?> ">
226
228
<span><?= $ block ->escapeHtml (__ ('Add to Cart ' )) ?> </span>
227
229
</button>
228
- <?php else :?>
230
+ <?php else :?>
229
231
<?php $ postDataHelper = $ this ->helper (Magento \Framework \Data \Helper \PostHelper::class);
230
232
$ postData = $ postDataHelper ->getPostData ($ block ->escapeUrl ($ block ->getAddToCartUrl ($ _item )), ['product ' => $ _item ->getEntityId ()])
231
233
?>
@@ -235,19 +237,19 @@ switch ($type = $block->getType()) {
235
237
<span><?= $ block ->escapeHtml (__ ('Add to Cart ' )) ?> </span>
236
238
</button>
237
239
<?php endif ; ?>
238
- <?php else :?>
239
- <?php if ($ _item ->getIsSalable ()) :?>
240
+ <?php else :?>
241
+ <?php if ($ _item ->getIsSalable ()):?>
240
242
<div class="stock available"><span><?= $ block ->escapeHtml (__ ('In stock ' )) ?> </span></div>
241
- <?php else :?>
243
+ <?php else :?>
242
244
<div class="stock unavailable"><span><?= $ block ->escapeHtml (__ ('Out of stock ' )) ?> </span></div>
243
245
<?php endif ; ?>
244
246
<?php endif ; ?>
245
247
</div>
246
248
<?php endif ; ?>
247
249
248
- <?php if ($ showAddTo ) :?>
250
+ <?php if ($ showAddTo ):?>
249
251
<div class="secondary-addto-links actions-secondary" data-role="add-to-links">
250
- <?php if ($ addToBlock = $ block ->getChildBlock ('addto ' )) :?>
252
+ <?php if ($ addToBlock = $ block ->getChildBlock ('addto ' )):?>
251
253
<?= $ addToBlock ->setProduct ($ _item )->getChildHtml () ?>
252
254
<?php endif ; ?>
253
255
</div>
0 commit comments