0

I am trying to use login session on magento/catalog/view/base/templates/product/price/amount/default.phtml to hide price from users not logged in.

However, it seems not working well with

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$customerSession = $objectManager->get('Magento\Customer\Model\Session');
if($customerSession->isLoggedIn()) {
    // customer login action
}

As well, I cannot find \Magento\Framework\App folder in my project. But, it seems working well tho. Is there any way that I can find this folder, and that makes it able to get login status?

Abhishek Panchal
  • 4,948
  • 3
  • 21
  • 38
Lee
  • 1
  • 1
  • You will find that folder in lib/internal/Magento or vendor/magento/framework. – amitshree Jan 09 '19 at 06:34
  • Due to enabled full page cache you might not be getting correct data. Check different ways to achieve it which is mentioned in the thread https://magento.stackexchange.com/q/91897/9169 – amitshree Jan 09 '19 at 06:48

0 Answers0