Fatal error is_product()

I've been having some installation problems where I get a fatal error: Fatal error: Call to undefined function is_product()

Sharing the solution in case someone else has this issue - the function is_product relates to the WooCommerce plugin, if you're working on a website (like mine) where no products or transactions are being sold - you have to enable the WooCommerce otherwise this error occurs.

This seems to me to be a flaw with the theme (which I otherwise am enjoying working with) - the call to action on my site is to contact me via email, not selling products and so it makes sense to deactivate the e-shopping plugin. If the theme is going to use a function from a plugin that is not always relevant, then there should be a test to see if the function exists/WooCommerce is activated.

To get the theme to work I'm enabling the plugin, but hiding all the associated components such as shopping basket etc. While I can edit the code to prevent the call to is_product, I would have to amend the code every time the theme is updated, so I'm hoping the authors will sort this out.

Cheers!


Comments

Sign In or Register to comment.