How can extensions show / hide blocks conditionally in Magento 2
In Magento 2 there are several ways of showing and hiding blocks conditionally. If its visibility depends on a configuration settings value, use the

In case of a more complex visibility condition, show and hide a block by overriding the
The block won’t be shown If you return the empty string from the method.
The above example illustrates how the block can be hidden or shown for anonymous or authenticated visitors. The
