# Woocommerce header and footer missing from category page

**URL:** https://discourse.roots.io/t/woocommerce-header-and-footer-missing-from-category-page/4012
**Category:** uncategorized
**Created:** 2015-06-10T05:38:36Z
**Posts:** 8

## Post 1 by @marjanbajc — 2015-06-10T05:38:36Z

Hi,

I’m having a strange problem. This is the website: [http://woodbraceletsbibi.com/](http://woodbraceletsbibi.com/)

It uses roots, woocommerce, wpml.

If I switch to product category page (Shop \> Wooden Bracelets) and then switch to any other language except English, it doesn’t load header and footer. I know it used to work, but I’m not sure at what point during updating Woocommerce it brake down.

I also know it it’s ignoring archive-product.php in theme folder.

Can anyone please help me troubleshoot this? Thanks.

---

## Post 2 by @marjanbajc — 2015-06-10T05:44:32Z

I see know that Woocommerce is completely ignoring the woocommerce folder in my theme.

---

## Post 3 by @kalenjohnson — 2015-06-10T05:57:54Z

If it was a WooCommerce update that broke your site, then you should probably see what happened with their updates. Their support would also be a good place to start

---

## Post 4 by @jorghe — 2015-06-22T14:10:56Z

Same issue there.  
I can’t tell if it is an update problem, since I’m working on my site right now.

Looks like the base.php is not included when I browse a category in a language that is not the main one. I tried to debug putting in random echoes, and it looks like the function \_\_toString() in wrapper.php is not called at all when I browse said pages.

---

## Post 5 by @kalenjohnson — 2015-06-22T17:28:23Z

> [@jorghe](#):
>
> it looks like the function \_\_toString() in wrapper.php is not called at all when I browse said pages.

`__toString()` is a magic method: [PHP: Magic Methods - Manual](http://php.net/manual/en/language.oop5.magic.php#object.tostring)

With an object, you generally interact with the object by calling it’s properties or methods. `__toString()` covers what happens if you do something with the class where a string is expected, IE:

```
$wrapper = new SageWrapping;
echo $wrapper;
```

`__toString()` would be used here.

---

## Post 6 by @jorghe — 2015-06-22T18:09:50Z

Ok, that’s cool, but that wasn’t my point. I’ll try to explain better, maybe you can point me in the right direction to debug this issue.

As I already said, it happens when you browse a category while a language different from the main one is selected. In short, the output contains only the content you put in woocommerce/archive-product.php (that is, no header, no footer, or whatever you wrote in base.php).

Trying to find out where things go wrong, I opened lib/wrapper.php. I see a class with 3 functions, so I wrote a couple of echoes in one of them at a time, then I compared the outputs between a page that works and one that doesn’t. I tryed to echo $templates, $base and a static string. The output is the same when I echo from construct and wrap. Echoes from toString() don’t show up in the pages with this issue, neither print\_r of $template nor the static string. From that I assumed that somewhere a “call” to toString is missing. Where should I look now?

---

## Post 7 by @jorghe — 2015-06-23T07:58:28Z

Ok, I found the problem!  
There is another hook that triggers with priority 100 and override what the wrapper is doing.  
So, in order to solve, I changed this line in lib/wrapper.php:

```
add_filter('template_include', [__NAMESPACE__. '\\SageWrapping', 'wrap'], 101); // priority 101
```

The hook that create the problem is set by Woocommerce Multilingual, the legacy plugin between WPML and Woocommerce.

Hope this can bel helpful also for you @marjanbajc !

---

## Post 8 by @marjanbajc — 2015-06-25T02:57:08Z

Ohhhhh yeaaaah! Great great job! Wouldn’t figure it out in a million years! Thanks so much!
