セッションからお客様IDを取得する方法は?私はこれを試しましたが、うまくいきませんでした。
protected $_customerBonusPointFactory;
protected $_customerSession;
public function __construct(Session $customerSession, \Magento\Framework\View\Element\Template\Context $context) {
    $this->_customerSession = $customerSession;
    parent::__construct($context);
}
public function _prepareLayout() {
    var_dump($this->_customerSession->getCustomer()->getId());
    exit();
    return parent::_prepareLayout();
}$this->session->isLoggedIn()コントローラークラスではtrue を返すが、ブロッククラスではfalseを返すことがわかりました。どうして?
                cacheable=false参照ブロッククラスのセッションから顧客IDを取得します- Magentoの2
                