`generoi/sage-woocommerce`: Header + footer in layout

When I use generoi/sage-woocommerce for WooCommerce support in Sage 10,
the products archive and single Blade-PHP/Sage templates are added:

https://github.com/generoi/sage-woocommerce/blob/c49760aa435a312f465bb934ff8fd03e98c69e42/publishes/resources/views/single-product.blade.php

The normal Sage theme header and footer are not added though, although the both templates extend from layouts.app. It appears that some of the WooCommerce-related functions output the header and footer markup in the content of the layout instead.

Odd :thinking: I’m using generoi/sage-woocommerce on a production site and not running into this issue

I also have two different test setups, one with just stock Sage with generoi/sage-woocommerce and one with Radicle with generoi/sage-woocommerce and I can’t reproduce this issue on any of the setups

1 Like

Are you already using 🎨 Move default theme markup to the `app` layout by Log1x · Pull Request #3167 · roots/sage · GitHub?

It’s possible it broke support with this somehow since the app layout changed. I can try to put a project together to test/tinker tonight if needed.

1 Like

@Log1x I just pulled in those changes to a sage project with generoi/sage-woocommerce and, so far, I’m not running into this issue.

1 Like

I pulled those changes but still have the issue. I create a minimal reproducible sample for that.

Thanks for verifying!

I do not use WooCommerce so someone else will have to look into why this is happening if it is not directly related to recent changes to Sage/Acorn.

So while preparing the reproducible sample I found the reason (of course…).
This piece of PHP caused it :roll_eyes: :

add_action('get_sidebar', function () {
    do_action('woocommerce_sidebar');
}, 10, 0);
3 Likes