Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

cyberEst1919's avatar

Wordpress and Woocommerce for a Laravel developer?

Hey! I'm a (I guess) medium skilled Laravel developer. One of my clients asked me to build his new website with a webshop. As the client (and his son) is very interested in Wordpress, and wants to manage the content of all the static pages as well as the products and all webshop related stuff by himself, he asked me to build everything in Wordpress. Most of the requirements are pretty straight forward, except for some things regarding the webshop:

  • Additional to the "normal" webshop for all users there should be a kind of special "premium" webshop with special products in it, only accessibly for authenticated "premium" customers. (So there needs to be some kind of authentication process for the premium users)
  • Some of the webshops products should be customizable. An example for that use case: let's say we're selling juices. There are five different kinds of juice flavors. One of the customizable products is a box that holds 15 bottles of juice, but the user can customize the content of this box individually. e.g: 4 bottles of juice flavor A, 5 bottles of flavor B, 3 bottles of flavor D and 3 bottles of flavor E.
  • At some point there should be an automated interface to the customers ERP system, synchronizing products and number of items in stock.

As I have nearly NO EXPERIENCE at all in Wordpress I'm hesitating on what would be the best way to go. I have a lot of beginner questions in my head like:

  • Is it in general possible to use Wordpress and Woocommerce for a project like this?
  • How can i handle authentication and the "membership webshop" in Wordpress / Woocommerce?
  • Should I try to convince the customer that we build everything from scratch in Laravel, altough he really wants to go with Wordpress?
  • Should I try to figure out some crazy way to use both, Wordpress and Laravel? (e.g. using Wordpress for the static pages, handling the webshop in Laravel. But how can the shop admin than manage products and all that..)

Altough I'm intersted in learning how to develop something like that in Wordpress, I'm hesitating. I have the feeling I have no idea what's my actual development workflow would be building an application like that in Wordpress. I really don't want to end up clicking around a lot in the Wordpress admin backend, without any clear path how to develop this thing, any version control (.git) in place, dependency management, etc... in generall my basic idea (and understanding) would be to build a custom Wordpress theme, try to establish some kind of development workflow with VCS, composer and everything inside that theme directory.. For handling the ERP synchronization, maybe I can build a custom Wordpress plugin that handles all that stuff? That - at least in my understanding - should be the way Wordpress developers are recommended to go, right?

Also I don't have any idea where to find GOOD Wordpress documentation or learning resources! There's a ton of super beginner stuff, tutorials with clicking around in Wordpress. I'm missing some kind of resource to learn how to professional develop Wordpress applications with a nice state of the art dev workflow... Any ideas for learning resources? Best thing would be some kind of Laracasts, just for Wordpress (means a developer friendly learning resource). Is there anything like that?

I don't want to start a "Wordpress vs Laravel" discussion here. I love Laravel and would try to build all this in Laravel from scratch if it's just my own decision. But I think in this case the client is to focused on Wordpress already to change his mind..

Would really appreciate some of your thoughts and advice regarding this "technology decision". How would you tackle this situation?

Any advice is really welcomed! thanks a lot in advance!

0 likes
9 replies
bobbybouwmann's avatar

This isn't a story of Wordpress vs Laravel, but more a story of how these two can work together. WordPress offers an API for everything that is available. So does WooCommerce as well. So you can let the customer manage everything in WordPress but build the shop itself in Laravel which is consuming the WordPress api.

Best of both worlds!

These resources might help you out:

6 likes
cyberEst1919's avatar

Thanks a lot for your reply! This sounds like a really interesting idea.

So just that i get that right. The architecture with this approach would look something like this:

  • a plain wordpress installation with the woocommerce shop plugin. only used by the clients admin, to create static pages (provide the content) and woocommerce products
  • a laravel installation which pulls all the static pages content and product data from the wordpress API
  • all the frontend stuff (design, ux) for the static pages as well as
  • the whole shop implementation (cart, checkout pages, etc) is built in laravel?

If i get that right it means all the routing for every page and authentication for the "members only shop" happens in laravel? (which would be awesome!) But that also means there must be some way to disable all the public available Wordpress pages? Respectively somehow turn Wordpress into a complete "headless" mode. Otherwise it would be possible to visit some weird, not styled Wordpress pages (or at least the Wordpress index page) on that Wordpress installation?

1 like
TerrePorter's avatar

Oh Yea WordPress fun, lol. I have been working with WordPress for about 8 or so months now. I started with zero experience with WordPress, saying that because it is not hard to learn just a pain in the butt to use sometimes.

  • Is it in general possible to use WordPress and WooCommerce for a project like this?

Sure, there are tons of sites that use that for their shopping carts, etc.

  • How can i handle authentication and the "membership webshop" in WordPress / WooCommerce?

Options, 1) use the WordPress login, 2) use Laravel auth. I think your going to be required to use the WordPress login for the WordPress stuff, now, you could setup a custom login plugin that would check the WordPress login and if it fails then try the Laravel and then if that fails then treat it as a bad login. I wouldnt do two separate login systems, that would be come very hard to manage later on. I would look at maybe a duel system, where it logins in to both WordPress and Laravel, would just have to figure out how. You could hook in to the account creation an do a api call to Laravel that creates the duplicate user in that system. Then a custom login could login to WordPress, and Laravel at the same time. You would also have to tie in to the password reset stuff.

  • Should I try to convince the customer that we build everything from scratch in Laravel, although he really wants to go with WordPress?

If you want too. But you will need to consider the time needed if writing most everything from scratch (or packages maybe) vs using WordPress and WooCommerce.

  • Should I try to figure out some crazy way to use both, WordPress and Laravel? (e.g. using WordPress for the static pages, handling the webshop in Laravel. But how can the shop admin than manage products and all that..)

I think this would be possible. You can run Laravel in a subdir on the WordPress site, then just modify the WordPress routes to direct the request to the Laravel page. I have some code that I used to overwrite the WordPress routes, so I can find that if you decide to go that route. It would take some tweaking to get it all set up but I am doing something similar in WordPress, just not to Laravel. The alternative would be to run WordPress in the subdir, and the main site would be Laravel. Then you could just use WordPress as an admin interface. You can use (or make) an api to access the data in the WordPress installation. Its possible, the question is if its worth the trouble.

  • a plain WordPress installation with the WooCommerce shop plugin. only used by the clients admin, to create static pages (provide the content) and WooCommerce products

Yes, this is what I would think of in the process.

  • a Laravel installation which pulls all the static pages content and product data from the WordPress API

Two ways to do this, you can either include the main WordPress class then use the WordPress functions to get products, coupons, handle the shopping cart calculations, etc. I dont remember any api that directly accesses the products, but there might be, if not you can write one in maybe a few lines of code. I think I may have some examples of that as well.

  • all the frontend stuff (design, ux) for the static pages as well as

Yes, you can make a custom theme that you can use git to keep in sync. Same with the custom plugins, you can use git on them too.

  • the whole shop implementation (cart, checkout pages, etc) is built in Laravel?

This is the tricky part. You could do all of that in Laravel, but it might be simpler to just use WordPress since it would already be built in and you would only need to make the page templates. I am a big fan of Laravel, but sometimes there is just not a way to work in using it on some projects. You would need to ask yourself, what am I using Laravel to do and is that the most efficient way or would just writing a plugin to WordPress and a custom theme (aka templates) be better.

  • would be possible to visit some weird, not styled WordPress pages (or at least the WordPress index page) on that WordPress installation?

Not a big problem, since you can overwrite the router in WordPress relatively easily. However, it could make the admin management the pages in WordPress a bit tricky.

-- Hope that helps. (really need a markdown preview... lol)

2 likes
cyberEst1919's avatar

Wow. Thanks, @terreporter as well for your thoughts on this! Helped me already a lot! As i understand it right now, it seems i hove to choose between two ways to go:

  • Option A: plain Wordpress & WooCommerce architecture Wordpress handles everything. The clients Admin logs in with default wp-admin, and is able to manage webshop products and static pages content. Custom theme development and a plugin to do the synchronization with the clients ERP system

    concerns:

    • not sure how to handle the membership (or premium) shop. a customer there must be logged in (authenticated) to buy the special products there. don't want to use the wp-admin Wordpress "backend" login for that. Other authentication methods seem a little bit painful, if I understand it right.
    • not sure if WooCommerce can handle these configurable products. the documentation I found so far isn't very clear about that imo..
    • general concerns because never worked with Wordpress before and because of that don't feel comfortable with it
  • Option B: Wordpress as headless CMS for the clients administration of pages and products, Laravel for handling the webshop and premium shop. Advantage there would be that I feel comfortable in Laravel to built a performant and secure Authentication solution for the premium shop. Also managing the customizable products and the synchronization with the clients ERP seems easier and more flexible to do..

    concerns:

    • two different systems / frameworks to handle for - still relatively - simple requirements. website and webshop.
    • also the two different login systems (wp-admin in Worpdress for the adminstrative backend; Laravel Authentication login for the premium shop) seems like a potential for causing complications..

hmm. gonna have to sleep over that. thanks so far everybody! any more ideas still welcome!

btw anybody knows good (and up-to-date) Wordpress learning resources / docs for professional theme and package development (full workflow for developers)?

Jaytee's avatar
Jaytee
Best Answer
Level 39

I don't think combining Wordpress and Laravel will be a great idea here. It's going to be more work for you, and ultimately, less $$$.

For authentication, use Wordpress. Wordpress comes configured with default roles, I'm not sure if you can extend these roles, but I'd say there's a high probability there is already a plugin for "premium" access.

Product variants (e.g: Juices) can be solved using Woocommerce's variable products: https://docs.woocommerce.com/document/variable-product/

Then it's just a case of linking up to the ERM yourself.

For the theme, is it mandatory that it is custom? What about finding a theme that meets some/most of the specifications and then customising it?

This type of application is common in Wordpress, and whilst we'd all prefer to build custom applications using Laravel, Wordpress paired with woocommerce is probably the best solution here. It'll take no time at all to get the website up and running.

I used to be like you, never knew Wordpress (still don't really) and always resorted to using Laravel if I could. The problem with that is, it takes time, and time is money.

TerrePorter's avatar

For a restricted store check this plugin, https://wordpress.org/plugins/woo-products-restricted-users/, I havent used it and there might be others.

For learning Wordpress its just php, the only catch is the hook system (actions and filters) which can be a pain. I didnt find many resources when I started, I just looked at the code of the plugin, and figured out what hooks they used then either added in my own hook or made a custom template that didnt use the original hook.

cyberEst1919's avatar

Yeah. Thanks a lot the two of you!

I had a more closer look at Wordpress and run an installation with WooCommerce locally. I guess, as @jaytee recommended, sticking with the "Wordpress only" option for now will be my first path to go.. If at some point this leads into a deadlock, or it get's to messy, I'll might outsource some functionality into a Laravel instance..

The general design and layout will come from a designer, so i plan on doing my own custom theme. Don't know if I want to mess around with existing Wordpress themes too much.. (always hate that most Wordpress themes seem to load hundred different javascript files)

Think I just do my own theme from scratch, using tailwind. If I understood it correctly I can set up my whole theme "frontend" build process (webpack, postcss, or whatever) and node dependencies, etc within the theme directory and build all the stuff there into the theme's .css and .js files?

That's the plan, let's see how it goes.

And yeah, @terreporter, also had a closer look at Worpress itself now. Used to Laravel this looks really messy and unstructured. No namespacing, all these functions... Everything I do in there feels like a hack.. But i guess that's just the way it fells in Wordpress?!

Garet's avatar

I do a lot of work with WordPress and WooCommerce.

You're right, it's one hell of a mess compared with Laravel.

You'll also find some of the things you want to do require additional plugins which often carry an annual fee, so factor that in. There are some very basic and fundamental things that often still require a paid-for plugin with WooCommerce.

The problem with developing a web shop from scratch in Laravel is that you'll be reinventing the wheel, and things you might take for granted in WordPress like basic content management could become a big undertaking in Laravel. Furthermore, when the client decides to, for example, change their payment gateway, with WooCommerce you'd buy a $50 plugin, whereas with Laravel you'll probably have a couple of days development work to achieve the same thing.

I developed a complex web shop last year using CodeIgniter and the end result was really nice, but the client had very specific requirements. I've worked on other web shops where the client's requirements change daily or the client themselves like to tinker, in which case WordPress/WooCommerce is probably more appropriate.

I do love Laravel now though and WordPress, and especially WooCommerce, feel like they're held together with duct tape by comparison.

jeremykes's avatar

I just came across this while looking for something similar. It looks promising so will give it a try. It looks like it works by having both a Wordpress (Woocommerce) site and a Laravel site. API calls are made to the Woocommerce API to perform basic CRUD and view operations.

https://github.com/Codexshaper/laravel-woocommerce

Please or to participate in this conversation.