Closed
Description
Preconditions (*)
- Magento 2.3.5 or 2.4-develop (I'm using commmit 1e28f35)
Steps to reproduce (*)
- Look at this piece of code:
- Remove a bunch of the inner structure until you have the following remaining:
<?php if ($showCart):?>
<?php if ($_item->isSaleable()):?>
<div class="actions-primary">
<?php else:?>
<?php endif; ?>
</div>
<?php endif; ?>
- Notice that the opening
<div>
and closing</div>
aren't in the same block, which can most likely result in incorrect html structure being outputted.
Expected result (*)
Either:
<?php if ($showCart):?>
<?php if ($_item->isSaleable()):?>
<div class="actions-primary">
</div>
<?php else:?>
<?php endif; ?>
<?php endif; ?>
Or:
<?php if ($showCart):?>
<div class="actions-primary">
<?php if ($_item->isSaleable()):?>
<?php else:?>
<?php endif; ?>
</div>
<?php endif; ?>
If I have to guess, it should probably take the second form, as that's the structure what other templates are following as well:
- ...
Actual result (*)
- See points 2 & 3 of steps to reproduce
Discussion
This seems to have been introduced in Magento 2.3.5 and 2.4-develop by MC-30989, the <div class="actions-primary">
was moved inside the <?php if ($_item->isSaleable()):?>
while it should probably have been left outside of it.