Roots Discourse

WooCommerce support for Sage 10

As I can not reply to the multiple already closed topics, I am opening another one:

I’ve forked and overworked sage-woocommerce for Sage 10 support. Plesase feel free to give it a try:

As WooCommerce is on the list of native support for Sage 10, I am looking forward to a final and propably more robust solution. So take it as a temporary fix.

8 Likes

This package have some problems. First of all:

When you’re in shop category it tries to load taxonomy-product_cat.php and if you don’t have such file error will be triggered, it should try to load archive-product.blade.php instead.

Another big one: wc_get_template( 'archive-product.php' ) loading twice. One from Woocommerce plugin template and one from theme, so in the end you have duplicate products rendered.

Thanks for your feedback @RomkaLTU .

As you mention it I remember that even with Sage 9 it was required to add a taxonomy-product_cat.blade.php and taxonomy-product_tag.blade.php to the template structure. I will add both files and a notice to the repo.

As I am am using Blade @include() instead of wc_get_template(), I did not recognize that.
Can you please verify that uncommenting line 75 (echo view($view, $data)->render();) fixes it for you?

Seems we both synchronized our work on the same day but with different solutions :slight_smile: https://github.com/generoi/sage-woocommerce

Mine is very untested though

1 Like

Another one: https://github.com/ptrckvzn/sage-woocommerce
Haven’t had any issue so far.

Hi @patrickv,

I could be doing something wrong, but using composer require roots/sage-woocommerce gets the sage 9 version.

I manually downloaded the sage 10 ZIP and replaced the files in vendor/roots/sage-woocommerce and it works like a charm.

This is absolutely the worst practice ever - would you be so kind as to guide me on how to composer require the sage 10 branch, please?

Thank you so much and sorry for the trouble.

Regards,
Sam

The roots/sage-woocommerce package explicitly states it supports only Sage 9: https://github.com/roots/sage-woocommerce#woocommerce-integration-for-sage-9-themes

The package @patrickv linked to is a different package. You would need to install that different package to use it. It doesn’t look like it’s published on Packagist, so you would need to configure composer to install it from git: https://getcomposer.org/doc/05-repositories.md#vcs

1 Like

Ah yes! There was a neuron trying to fire somewhere in my brain coz that’s what I do for ACF.

Thank you so much for your help, sir, very much appreciated.

1 Like

Not wanting to start another thread for Woo/Sage 10 and you always seem to have very sound advise. I’m a long time Roots/Sage/Woo user but am struggling to get 10 running with Woo. I’ve tried all the packages I’ve found through the threads but am getting errors.

I need to know if I should move back to Sage 9 with Woo or if there is anyone that has gotten it working with 10 without crazy effort. I’m also scared because I will also be running Woo Subscriptions and would hate to find myself down a rabbit hole after a bunch of work.

Hola! I am currently building out my first woocommerce site and am using sage 10. I’ve of course have run into a few snags with compatibility since there isn’t a

The solutions I’ve tired are listed below:
ouun/stage-woocommerce
ptrckvzn/sage-woocommerce

Both seem to work for basic customization however I have to dig a little deeper and change the tabs template. Tabs template

I’ve created the template file tabs.blade.php to override the template file:
theme/woocommerce/single-product/tabs/tabs.php

Using either of the above solutions I get the same error.

ErrorException (E_ERROR)
Unrecognized extension in file: SageWoocommerce::empty. (View: /srv/www/theme.com/current/web/app/themes/theme/resources/views/woocommerce/single-product.blade.php)
Previous exceptions
Unrecognized extension in file: SageWoocommerce::empty. (0)

throw new InvalidArgumentException("Unrecognized extension in file: {$path}.");

Going to switch over to generoi/sage-woocommerce and give it a try but was wondering if anyone had any insight on this error.

Do open a bug report in the github repository if it doesn’t work

I wasn’t able to use it. I didn’t know what you meant in the readme file in terms of the setup. I actually defaulted back to ptrckvzn/sage-woocommerce It turns out I needed to add an empty.php file to views in order to get the nested woocommerce template to work. That removed that error.

I came to that conclusion with colleagues and not on my own.

1 Like