Run into another problems and would be grateful for a helping hand or two.
In /resources/views/woocommerce
I’m trying to override the cart and checkout page for woocommerce, but they don’t seem to be picked up by sage/sage-woocommerce. Other templates works, so I’m wondering if there’s something i missed?
Not that i’m aware of. Though I’m pretty ignorant about the FSE and blocks in general.
Is there a setting or lines of code that says my theme is a block theme? (Did a quick search and doesn’t seem mine is. My theme.json also doesn’t indicate anything about FSE/Blocks.)
When I go to Appearance->Customize, it’s the old style wordpress menu instead of blocks.
Yes. I’ve done discover and publish, and yes other templates work.
So myaccount works and archive-product and single-product works.
And with cart and checkout, it doesn’t. Since you mentioned block themes, I’d like to mention that when I navigate to the cart and checkout page, blocks are generated. (i.e. it’s just a lot of div with nothing in the html.)
I’ve also tried putting cart.blade.php up a level (/woocommerce/cart.blade.php) to no avail.
This confirms the suspicion that those are Gutenberg blocks. Those can not be overridden like classic WooCommerce blocks.
From server side the render_block filter can be used. Depending on the block (server-side rendered or hybrid (JS + server-side)) the block edit React markup may also need to be adjusted.
You may also find this discussion interesting:
Note that this particular discussion is about a product list - but there are different approaches to re-using the classic/server-side markup and modifying it for those Gutenberg blocks, so this could be useful with the cart block also.
For anyone who might have the same problem, Woocommerce now install all the pages with blocks instead of shortcode. You can remove the default blocks from the cart and checkout page and insert the old shortcode with a shortcode block. This will return Woocommerce to its old behaviour.
Hi, after installing the plugin I tried to edit woocommerce/single-product.blade.php, but the changed won’t appear in the browser. Do you have any idea how to get this working? I followed all steps in in the installation…
Are you using the shortcodes for the legacy WooCommerce pages?
Otherwise not the classic WooCommerce templates are used, but the Gutenberg blocks instead (with their own backend/JavaScript editor templates).
Thanks for the reply. I’m talking about normal product pages. It looks like the package isn’t completely loaded. The theme still thinks WooCommerce support isnt active…