How can I display a different html module like WelcomeBack when user is logged it?
Or even further display html subject to Customer Group
OC 3.0.4.1
PHP 8.2
Keep Smiling
Code: Select all
{% if logged %}{{ text_return}}{% else %}{{text_welcome}}{% endif %}
For names it will be a bit more complicated but it is something that used to be requested quite often for OC1 so if you check the marketplace you might find something free that you can use as an example. This pretty much covers it viewtopic.php?t=7222&start=40
Note $this-> is no longer used it is just $data - but all you have to do is look at the current file for the same page and convert it to the same format.
Same with
Code: Select all
<?php if (!$logged) { ?>
Not very complicated and worth trying yourself.
For more personalised or customer groups it will be much more complicated and require a full module.
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
OC 3.0.4.1
PHP 8.2
Keep Smiling
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
php
Copy
Edit
<?php if ($this->customer->isLogged()) { ?>
<!-- WelcomeBack HTML -->
<?php } else { ?>
<!-- Welcome HTML -->
<?php } ?>
For customer groups, use $this->customer->getGroupId() to show content based on group.
You may use my extension "Extended Layout" to manage it.
My FREE extensions in marketplace. [ security | flexibility | speedup ]
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
Users browsing this forum: Amazon [Bot] and 45 guests