Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Albert Juhé Lluveras

    (@aljullu)

    Hi there, @pjaypokhrel,

    Yes, it’s possible to use the Mini-Cart block in classic theme headers. You have two options for this:

    1. Updating your classic theme to support block template parts: it’s possible for a classic theme to support block templates parts (like the header template part). You can find a video tutorial here, and a guide in this post.
    2. Print the block in the header PHP file: you can alternatively print the block directly via PHP wherever you want. You can do so with this snippet:
    echo do_blocks( '<!-- wp:woocommerce/mini-cart /-->' );

    Hope that helps!

    Thread Starter Pjay Pokhrel

    (@pjaypokhrel)

    Many thanks Albert!! It worked well.

    <div class="header-mini-cart">
    <?php
    echo do_blocks( '<!-- wp:woocommerce/mini-cart /-->' );
    ?>
    </div>
    • This reply was modified 1 year, 1 month ago by Pjay Pokhrel.
    Plugin Contributor Albert Juhé Lluveras

    (@aljullu)

    Great, glad to hear it worked! 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Displaying WooCommerce Mini-Cart Block in Non-Block Theme Header’ is closed to new replies.