I'm trying to integrate my opencart store with ContactPigeon. ContactPigeon needs the email of the customer if the customer is logged in.
Journal 3 is my current theme.
They suggest to add the code in footer before the </body>
tag.
I went on catalog/controller/common/footer.php
and I add the below code
$data['logged'] = $this->customer->isLogged();
$data['customer_email'] = $this->customer->getEmail();
… inside index()
function.
Then I went to catalog/view/theme/journal3/template/common/footer.tpl and I add the below code:
if($logged){ console.log('logged in'); }else{ console.log('not logged') }
I got error in console saying
$logged is not defined
I have already tried to refresh Modifications but not worked.
In Journal 3 .tpl and OC 2.x you should retrieve data something like this: catalog/controller/common/footer.php
$data['logged'] = $this->customer->isLogged();
$data['customer_email'] = $this->customer->getEmail();
$data['logged_in'] = 'Logged In';
In journal 3 catalog/view/theme/journal3/template/common/footer.tpl
<?php if ($logged): ?>
<?php echo $logged_in; ?>
<?php endif; ?>