I tested that PHP Snippet on a clean Woo install and it does work.
Which means another plugin is changing that behaviour.
It maybe the Nested Categories or the Filter that is affecting that.
Might be worth checking with those plugin authors if they are changing the templates.