Fatal error with WooCommerce and templates

Hi!

I’m working on a WooCommerce site and have started on editing templates. Everything has been working well, until it stopped working. I have no idea if I did or didn’t do anything before it stopped working.

  • The site seems to work well otherwise.
  • Showing product categories works as expected.
  • Showing a single product does NOT work anymore. This did work before, and it worked with the very same template I’m working on.

Thankful for help or input. :slight_smile:

More info in private:

Hi Christoffer,

Thanks for reaching out.
It seems that problem with the WooCommerce plugin, but it is not very clear what is the reason behind the issue. I would like to suggest troubleshooting the following common issue to help us to recognize the reason.

  1. Theme Related Issue
  2. Plugin Conflict
  3. Theme Update related issue
  4. Child Theme Related issue
  5. CSS/JS Customization
  6. Disabling Cache
  7. Disabling CDN

If you discover that an issue is coming from a custom code or 3rd party plugin, kindly consult with a developer or contact the plugin author. Please note that we do not provide support for custom codes and 3rd party plugins.
I would also request you activate any of the default themes like TwentyTwenty and check if the issue persists or not, if the issue exists, please inform the plugin author of this. If not, please provide login credentials for your site to examine it further, including:

– WordPress Site URL & Login URL
– WordPress Admin username/password

To create a secure note, click the key icon underneath any of your posts.

Thanks

Hi again!

I’ve been having to work with a few other projects, and also had a cold, therefore I haven’t visited this topic until now.

Thank you for your answer. I have deactivated all plugins except WooCoommerce and Really Simple SLL. Still no changes.

I also changed theme to Twenty Twenty-One, and the product shows as expected. The problem seems to be with Cornerstone, but I still cannot figure out why, since I know it really should work…

Hi Christoffer,

I have checked your website through the WordPress admin dashboard, but didn’t find the issue you described in your first post. Can you please let us know the steps to replicate the problem?

Thanks

Hi @tristup!

Check this link for example:
https://www.vent4ventgrossist.se/shop/plat/galvplat/

Or any other product page. This is the public view/front pages. The WP admin pages for products seems to work as a charm.

Also, I saw a problem with one of the product categories:
https://www.vent4ventgrossist.se/produkt-kategorier/plat/

It works, but I get this error code above, since I have the debugger on.

Another product category works great though, without any error codes, see this link:
https://www.vent4ventgrossist.se/produkt-kategorier/ventilation/

Thanks for your help!

Sincerely

Christoffer

Hello Christoffer,

I have investigated the issue further and I found out that the Fatal Error is caused by the Related Products element which you have added in your custom header.

I already removed the said element so that you can continue working on the pages and your layouts. Please be advised that not all elements will work on all pages. There are elements that can be used only for specific pages. The Related Products element can only be used in WC Single layouts. It will not work when you add it to other pages. It may even cause issues like what you have experienced.

Best Regards.

Oh, thanks again, @ruenel!!!

Dude, I was not gonna be able to figure that out myself. I do remember now that I added the related posts to the global header as a test to have it near the already added products, but since the problem only appeared on single products pages and not everywhere, I totally forgot about that one. I got so focused on that very template. I did remove a “related items” section in the Single Products Template (since I saw in the debug that it was something about “related products”, but since that didn’t do the trick, I just became even more mind boggled.

Thanks for saving my butt! You rock!

No problem, @Christoffer_Ahlback.
Please let us know if you need any further assistance.

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