I want to override


with some changes.

Default layout output:- enter image description here

Expected output:-

enter image description here

Here I want to move comment div out side "product-item-info" div.

Please let me know the magento2 best practice to achieve this.

1 Answer 1


You can override this file in your custom theme. Because using wishlist_index_index.xml that change is not possible.




Content for this file is..

/** @var \Magento\Wishlist\Block\Customer\Wishlist\Items $block */
$columns = $block->getColumns();

<div class="products-grid wishlist">
    <?php if (count($block->getItems())) : ?>
    <ol class="product-items">
        <?php foreach ($block->getItems() as $item) : ?>
            <li data-row="product-item" class="product-item" id="item_<?= $block->escapeHtmlAttr($item->getId()) ?>">
                <div class="product-item-info" data-container="product-grid">
                    <?php foreach ($columns as $column) : ?>
                        <?php if($column->getNameInLayout() != 'customer.wishlist.item.inner'): ?>
                            <?= $column->setItem($item)->toHtml();?>
                        <?php endif; ?>
                    <?php endforeach; ?>
                <?php echo $block->getLayout()->getBlock('customer.wishlist.item.inner')->setItem($item)->toHtml(); ?>
        <?php endforeach; ?>
    <?php else : ?>
        <div class="message info empty">
            <span><?= $block->escapeHtml(__('This Wish List has no Items')) ?></span>
    <?php endif; ?>

<?php foreach ($columns as $column) : ?>
    <?= $column->getAdditionalHtml() ?>
<?php endforeach; ?>

Hope this will help you!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.