Oh snap, I think I know what I’m doing wrong. Does the composer require roots/sage-woocommerce
have to run in a specific folder? I’m now running that in the {project_name/site} folder. I just noticed in @mejta 's example that he runs it in the {project_name/site/web/app/themes/theme_name} folder.
Hey, yes that is the problem. roots/sage-woocommerce
is a dependency of Sage theme. If you install it as a bedrock dependency it won’t work.
It works now! Have another question though. When I click on a shop item (in my case it’s a product-category) the page crashes with this message:
Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Call to a member function startSection() on null in /srv/www/{project_name}/current/web/app/uploads/cache/8c3128b400fa971dbd2c596b4bb67d4864d3b4c2.php
That didn’t happen before. Do you know what this might be?
The error you are mentioning is caused by @section
directive. There are two types of templates that WooCommerce uses:
-
page templates, e.g. archive-product.blade.php, single-product.blade.php
Those templates have@secton('content')
directive in there. You can identify those templates by looking into the WooCommerce plugin templates folder and any template that containsget_header()
function call is a page template. -
partial templates
They are included by callingwc_get_template_part
orwc_get_template
and those templates cannot have@section
directive. Those templates are also called from page templates, so you can be sure that you have your layout as it should be.
Ahhh makes sense, thanks! I removed the @extends directive now in my newly created taxonomy-product_cat.blade.php
. For people running into this error: make sure to change wc_get_template_part('archive-product.php')
into this: @include('woocommerce.archive-product')
.
Have you tried this? Got some pretty awesome features:
This is a sage 9 theme fork
I confirmed the package sage-woocommerce
is working. Update to 17, Mar 2019
I do not get the sidebar working. I also made a subfolder in my theme /woocommerce/global/sidebar.blade.php but stil no sidebar showing… Does anyone have an idea?
Hi, @paulus005! I am experimenting with sage-woocommerce
as well. I wasn’t too clear on how to get started. Stumbling along, but getting there
Have you tried putting sidebar.blade.php
in to the resources/views/woocommerce
folder of your Sage theme?
Same problem in here, But I got the solution but i dont think this is the best practice. I added in resources/sidebar.php and it works. Still i dont know what is the best practice on this.