change event to layout_load_before
change event to layout_load_before

Event controller_action_predispatch will only work on CMS and product page. On category page
you will get the exception: Catalog Layer has been already created, throwed on Magento\Catalog\Model\Layer\Resolver (54), because the
layer has been already created.

Using event layout_load_before will make it works on every page.

samgranger/StoreCodeBodyClass