Is Cornerstone compatible with WooCommerce Cart and Checkout Blocks

Hello,

It looks like WooCommerce is now using blocks by default for the Cart and Checkout pages. These block layouts are a huge improvement on the old shortcode method for these pages and I want to use them. But I can’t create a Cornerstone WooCommerce Single Layout for the Cart/Checkout pages as it doesn’t allow me to override the page template being pulled from the page itself. I was previously doing this on a build in October 2024 where I could use “The Content” element to pull in the blocks on the page but that element is no longer showing in the element list. Have you removed this from the list for WC Single Layouts?

I’ve also tried assigning a regular Single Layout page but that doesn’t seem to override the page template either. Any advice?

Hello @boomfly,

Thank you for the inquiry.

Yes, you can still use the Cornerstone (CS) builder to create a custom Checkout or Cart page, but you will need to use the classic Woocommerce shortcodes, such as [woocommerce_checkout] or [woocommerce_cart].

https://woocommerce.com/document/woocommerce-shortcodes/

Unfortunately, you can’t use Blocks in the CS builder. Let us know if you need more info.

Best regards,
Ismael

Hi @Ismael, thanks for your quick reply.
As I said, I have been able to do this with “The Content” element and have sites using Blocks on a CS WooCommerce Single Layout that work with this method. But now the element is missing from the list so I’m unsure what’s happened. Can you confirm if it’s been removed?

I am not aware if this element was available previously, but I can confirm that it doesn’t exist in the documentation. I will leave the thread open for others to check.

It was definitely there. I was able to use it in a previous build. See the image below and note the WooCommerce Single Layout and The Content element.
I got it working by exporting the page as a template from a previous build and import into this one.

Yes, I can confirm that the element is available but only for Single Layouts. I didn’t know this – apologies. Unfortunately, it causes a preview error on the cart page and it is no longer editable. Can you confirm this?

Using the classic shortcodes in the Cornerstone builder works fine without issues.

You won’t get preview errors if you set the condition for the Cart page and the preview page to Cart. If you get an error doing this for the Checkout page then you just need to add a product to your cart and then the checkout works. It seems WooCommerce has an internal redirect when the Checkout is empty to the Cart page.

Thank you for the info. However, for some reason, we can’t get this to work on our end and are getting stuck here:

After changing the preview, we got the error shown in the screenshot above, which makes the single layout inaccessible.

You can leave it as is if it’s working on your end

You don’t seem to be using a WooCommerce Single Layout. My understanding is that they are built for the purpose of overriding the layout of the Cart/Checkout/MyAccount pages. If you used a “The Content” element on a regular Single Layout, copy the section into a WooCommerce Single Layout and assign conditions and preview accordingly.
Also I think you may need to set your store to “Live” in the WooCommerce settings as I think the “Coming Soon” setting causes issues.

1 Like

Ah yes, you’re right. That is the default Single Layout. Unfortunately, the The Content element is not available in the WooCommerce Single Layout and we didn’t try copying the section from the Single Layout as you suggested. What we did is create a custom shortcode to retrieve the content from the block editor

function x_return_block_editor_content_shortcode($atts) {
  global $post;

  if (isset($post)) {
      return apply_filters('the_content', $post->post_content);
  }
  return 'No content found.';
}
add_shortcode('x_return_block_content', 'x_return_block_editor_content_shortcode');

Add the [x_return_block_content] shortcode in a Text element.

This seems to work well with the CS builder.

Thank you for the info.

Thanks for the workaround. Technically the “The Content” element should work as it was there a few versions ago. How does your workaround differ from this? The whole point of the WooCommerce Single Layouts are to style these pages but without a way to pull in the page content (i.e. “The Content” element) natively in CS, it makes the feature null and void for this use.

It’s clear that WooCommerce is progressing and using Blocks will be the default way forward. Soon enough they’ll phase out the use of the classic shortcodes pushing users to Blocks and Themeco should be proactively putting measures in place to accompany this. WooCommerce integration and customisation is a big part of where CS falls down and has been this way for several years. Ask any other user that has tried to custom build a shop with CS and they will say the same. CS could have the potential to be a market leader in this but seems Themeco’s focus is elsewhere and WooCommerce gets a “that’ll do” approach.

Thank you for sharing your thoughts. We’ll forward this thread to our channel.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.