I created a custom function in my theme files (I use Headway 2.0.13) and used Widget Logic to display my shopping cart widget only when there are items in the cart. (I use Cart66 to handle my shopping cart needs)
Until I upgraded to the most recent version of Widget Logic (v0.51), this function was working as expected. After the upgrade, I am receiving a fatal error that crashes my site. When I deactivate the Widget Logic plugin, the site loads as expected, except that my cart widget is now displaying irrespective of the number of items in it.
How can I fix this? [Code and error info is below]
This is the code I use in the custom_functions.php file of my theme:
/* // Displays cart widget if there are items in cart */
function check_cart66_cart()
{
if(Cart66Session::get('Cart66Cart')->getItems())
{
return true;
}
else
{
return false;
}
}
This is the code I put in the Widget Logic field of the shopping cart widget:
check_cart66_cart()
This is the fatal error generated after I upgraded Widget Logic:
Fatal error: Class 'Cart66Session' not found in [...directory info...]/public_html/wp-content/themes/headway-2013/custom/custom_functions.php on line 46