Error with page

Multipurpose WordPress Theme Forum Support
GK User
Wed Jun 03, 2015 3:11 pm
Hello,

I've made a page beside the frontpage which I'm trying to reach, but as soon as I go to that or any other page I get this error:

Fatal error: Call to undefined function is_woocommerce() in /public/sites/www.domain.com/wp-content/themes/Quark-Ecommerce-Child/header.php on line 31

Any idea what this could be?
User avatar
Junior Boarder

GK User
Thu Jun 04, 2015 11:27 pm
Hello,

Do you have woocommerce plugin enabled? Let me know if you don't want to use this plugin, then I'll give you a solution.
User avatar
Moderator

GK User
Thu Jun 11, 2015 10:21 am
No don't have it activated, I guess I don't need it also.

For now I removed some strings out of the header.php and that seemed to help, would like to know if your solution is the same.
User avatar
Junior Boarder

GK User
Tue Jun 16, 2015 8:19 am
Please edit header.php file and after this line (at the beginning):
Code: Select all
global $woocommerce;


add:
Code: Select all
if (isset( $woocommerce )) {
   $wc_condition == !is_woocommerce() && !is_checkout() && !is_cart();
} else {
   $wc_condition == '';
}


now, please replace this fragment:
Code: Select all
if (is_category() || is_author() || (is_singular() && !is_attachment()) && !is_woocommerce() && !is_checkout() && !is_cart()) {
         $dark_img = 'dark-bg';

with:
Code: Select all
if (is_category() || is_author() || (is_singular() && !is_attachment()) && $wc_condition ) {
         $dark_img = 'dark-bg';


we'll add this fix into the next theme update. Thank you for your feedback.
User avatar
Moderator


cron