Sage9-Woocommerce-Integration
Sage9-Woocommerce-Integration copied to clipboard
header.php, footer.php or sidebar.php template missing deprecated notice
Issue do not seem to have a proper fix. Made few non-conclusive tests.
Error: Notice: Theme without sidebar.php is deprecated since version 3.0.0 with no alternative available. Please include a sidebar.php template in your theme. in C:\laragon\www\mnp\wp-includes\functions.php on line 3984
. (also with header.php
or footer.php
).
See https://github.com/roots/sage/issues/610.
NOT WORKING: I didn't success to prevent only prevent notice error to no be displayed.
~~Remove "notice" verbose level:
~~I removed "notice" verbose level from output using a mu-plugin.
Create /wp-content/mu-plugins/verbose.php
~~
~~Containing:
error_reporting(E_ALL ^ E_NOTICE); //all except notice
~~
~~In wp-config.php
add
error_reporting(E_ERROR | E_WARNING | E_PARSE); //report only error, warning, parse errors
~~
Source that have some useful links also about customizing verbose level (and this).
As seens from: https://github.com/roots/sage-woocommerce
By default, you will get an error message that themes without header.php, footer.php and sidebar.php are deprecated. You have to replace single-product.php and archive-product.php templates with your Blade template. You can find those two files in /examples/views folder of this package. The trick is not to use get_header, get_footer or get_sidebar functions, because it's handled differently with Blade. Instead of that, you can use actions:
do_action('get_header', 'shop');
do_action('get_sidebar', 'shop');
do_action('get_footer', 'shop');