I've a helper and in the __construct() something like:
public function __construct(
Context $context,
\Magento\Customer\Model\Session $customerSession
)
{
parent::__construct($context);
$this->_customerSession = $customerSession;
}
he problem is when I can the $_customerSession object data it's empty, even though I've logged in.
It seems the session is instantiated at a later point in the process, because if I call the customer\Session object in a page Model or block it works fine. In fact, the whole store works as expected. I can see the logged in welcome message at the top right bar, add products to cart, login.
Thecode above is dispatched in the event
catalog_product_get_final_price
How do I make sure the session is loaded or how do I know when it's loaded?
use \Magento\Customer\Model\Session
on that class