When I use generoi/sage-woocommerce
for WooCommerce support in Sage 10,
the products archive and single Blade-PHP/Sage templates are added:
{{--
The Template for displaying product archives, including the main shop page which is a post type archive
This template can be overridden by copying it to yourtheme/woocommerce/archive-product.php.
HOWEVER, on occasion WooCommerce will need to update template files and you
(the theme developer) will need to copy the new files to your theme to
maintain compatibility. We try to do this as little as possible, but it does
happen. When this occurs the version of the template file will be bumped and
the readme will list any important changes.
@see https://docs.woocommerce.com/document/template-structure/
@package WooCommerce/Templates
@version 3.4.0
--}}
@extends('layouts.app')
@section('content')
@php
This file has been truncated. show original
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.
ben
January 8, 2024, 5:16pm
2
Odd 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
Log1x
January 8, 2024, 7:01pm
3
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.
Log1x
January 10, 2024, 4:19am
6
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 :
add_action('get_sidebar', function () {
do_action('woocommerce_sidebar');
}, 10, 0);
3 Likes