0

I am making changes to Luma theme. I want to move the minicart icon (module-checkout/view/frontend/templates/cart/minicart.phtml) to a different location. <?php echo $this->getLayout()->createBlock('magento_checkout/sidebar'); ?> doesn't seem to work. Do I need to create a module for this? I created a theme by extending Luma and I do all of the changes in app/design/frontend/VendorName/ThemeName/*

I come from Magento 1 and Magento 2 is really new for me.

Thank you.

0

This is simply solved using XML. For example, I move minicart to left sidebar.

app/design/frontend/VendorName/ThemeName/Magento_Checkout/layout/default.xml:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <move element="minicart" destination="div.sidebar.main" before="-" />
    </body>
</page>

Don't forget flush cache after modifications.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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