In this post I am going to explain how to check customer is logged in or not in PrestaShop 1.7.

1) Inside module or controller file (php)

if ($this->context->customer->isLogged()) {
	echo "Logged In";
	// Do something here
} else {
	echo "Not Logged In";
	// Do something here
}

2) Inside template file (tpl)

{if $customer.is_logged}
    {l s='Logged In' mod=''}
{else}   
    {l s='Not Logged In' mod=''}
{/if}