I'm struggling with a theme change. I would like to move the add to wishlist and add to compare actions from next to the add to cart button to next to the price.

what my theme (unfinished) looks like now: enter image description here

what the designer wants: enter image description here

I am trying to avoid copying a bunch of phtml files in my theme, I have seen it is possible to move the element with

<move element="category.product.addto.compare" destination="destination" />

however Im wondering how can I find the layout name of the price section? Path hints show me the phtml files and the block class names but does not seem to help me find the *layout names.

  • Can you check your themes list.phtml? Commented Sep 18, 2018 at 17:20
  • Thanks your comment was the one that really summarizes what seems to be the answer the best. I do not have a list.phtml yet in my theme (it inherits the Blank Magento theme) but I can find that the things I want to change are in there in the parent theme (at vendor/magento/module-catalog/view/frontend/templates/product/list.phtml). So basically since its all in this html template (the stuff I want to move, its container and the container I want to move to). I guess it means there is no way this can be changed just with layout xml but I'll need to copy list.phtml in my theme and modify it. Commented Sep 19, 2018 at 15:06
  • Are you using your theme's parent theme as blank theme? Commented Sep 19, 2018 at 15:20
  • Check my answer. Commented Sep 19, 2018 at 15:26
  • yes Sukumar I am using Magento blank as parent theme, and your answer is what worked for me. Thanks! Commented Sep 21, 2018 at 15:22

2 Answers 2


You need to copy the following file:




And move the below code snippet:

<div data-role="add-to-links" class="actions-secondary"<?= strpos($pos, $viewMode . '-secondary') ? $position : '' ?>>
    <?php if ($addToBlock = $block->getChildBlock('addto')): ?>
        <?= $addToBlock->setProduct($_product)->getChildHtml() ?>
    <?php endif; ?>

Just after the below code snippet:

<?= /* @escapeNotVerified */ $block->getProductPrice($_product) ?>

Now what you need to do is css fixing.

  • yep, dont have enough rep to upvote but that is the answer that worked for me Commented Sep 21, 2018 at 15:20
  • You can accept the answer by clicking the tick mark near my answer. Commented Sep 21, 2018 at 15:29

The default xml for said layout should be in vendor/magento/module-catalog/view/frontend/layout/

I don't have a magento installation right here but let me know.

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.