Quote Originally Posted by Laszlo View Post
Hi All,

I started getting this error in my logs:

PHP Fatal error: Call to a member function count_contents() on a non-object in ../gifts4baby.ie/includes/templates/winchester_responsive/common/tpl_header.php on line 106

I tracked it down to Google bot visits to the site.

The template tries to display how many items are in the cart in the top right of the page and it accesses $_SESSION['cart'] to do that.

The problem is _SESSION['cart'] does not exist when bots visit (no session is created by Zencart) so the fatal error occurs.

The issue though is that this seems to work fine on an empty test store I set up in 20 minutes, so it appears that the Winchester template somehow manages to have something meaningful in $_SESSION['cart'] when a bot visits, on my test store, but not the real store.

Perhaps I have some customisation that causes this.

Anyway I am trying to understand how does the template get _SESSION populated for a bot.

Any help would be appreciated.

As things stand, the bot does not see anything other than the very top of the page and dies when displaying the cart content in the top right corner so site indexing is very broken by Google.

Thanks,

Laszlo
This is not a problem with the template out of the box. Do a test install with the un modified template to see the correct behaviour.

Thanks,

Anne