-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add WooCommerce support #2086
Add WooCommerce support #2086
Conversation
Hey thanks for the PR. Looks like this is mostly a duplicate of #1923 (feel free to review that PR and poach anything you want from it), which we discussed internally and decided against. Something like this should probably be in our docs or as a guide on our website (for example, we already have a guide for using WooCommerce with Sage 8.x, but not one for Sage 9). I believe @retlehs can get you set up if you want to publish a guide on our site. I'll still leave the PR open for now in case any other members of the team have had a change of heart. |
Hi, Thank you for your reply. I saw your pull request, but it didn’t work as expected. In this PR I use different filters and it catches all templates now without errors mentioned in previous PR (with exception of get_header/footer/sidebar). I also feel that problems with WooCommerce implementation are so frequent that it should be supported. Also WooCommerce is created by WordPress authors and that makes this plugin somehow special. So I would vote for merging :) If decidion won’t be to merge that, I will be happy to publish the blog post with the guide on your site. |
@bdmason wrote this up as a guide this week: https://gist.github.com/bdmason/f26bb8891a3c066ce609200d5ad95912 was planning on publishing this on the site once i gave it a quick test. this PR also seems like a good approach |
but to follow up on what @QWp6t said, we'll be looking to keep this as a guide rather than including by default within sage it could possibly be an option in the sage-installer
this doesn't mean much to us fwiw. jetpack 🚮 was also written by wordpress authors, and woocommerce somehow gets away with aggressively promoting that garbage within their own plugin |
It's a nice approach. I think it'd serve nicely as a mu-plugin brought it via Composer rather than directly into sage/sage-installer along with a conditional wrap checking for |
I like the "just works" promise of this solution, and the fact that templates are within |
It would be a great addition to Sage installer, but not included by default. |
Could this be packaged as a composer library and autoloaded? This and the Bootstrap Navwalker might make a good start of a “useful Sage addons” set of composer libraries managed (or at least endorsed) by Roots? |
Thank you all for the inputs. I understand that this won't appear in Sage. So now the question is if I should write a guide and how @retlehs? And this is a really no-config piece of code that can be autoloaded with the composer. I think that @MWDelaney had a great idea about the curated Sage addons list. (I'm also a fan of minimal code, so I made a refactoring to make the code even smaller.) |
@mejta i created a repo at https://github.com/roots/sage-woocommerce - could you please submit a PR over there with the code from this PR? just need to add a |
I will, later this week. |
I also wrote a quick repository to make Sage 9.0.1 works with Woocommerce 3.4.3 : https://github.com/mtx-z/Sage9-Woocommerce-Integration. It's not as tested as https://github.com/hambos22/sage-woo maybe, but it is "easily" applicable to a fresh Sage app (to get blade and controllers working). It uses the woocommerce.blade.php technic (hambos22 don't). |
@retlehs Please, can you initialise the repository https://github.com/roots/sage-woocommerce with readme file or something? It's not possible to fork and open PR in an empty repository. Thank you. |
@retlehs I've created https://github.com/mejta/sage-woocommerce repository that can be cloned to the repository you've created. |
thanks @mejta - just imported it to https://github.com/roots/sage-woocommerce |
@mejta @retlehs Hey guys! I really tried everything regarding WooCommerce and sage 9. I installed the composer package |
@bramvdpluijm can you start a thread on https://discourse.roots.io to discuss this issue? |
Sure thing. I created this https://discourse.roots.io/t/woocommerce-sage-9-blade-support/13300. Have a look @MWDelaney . Feel free to join the discussion. |
Making WooCommerce work in Sage can be a hard task to do right for a beginner. I tried to find a way, and this is what I came with. I think that WooCommerce is such a popular plugin that it should be supported out-of-the-box. I've created the pull request with an as little footprint as possible.
With this pull request, you can easily overwrite any WooCommerce template by placing it into
/resources/views/woocommerce
folder, and it just works. You can even use controllers to inject variables you need as usual. Hooks are called only if WooCommerce is activated, checking theWC_ABSPATH
constant defined.