Post by bybrkbzn » Mon Feb 05, 2018 1:50 pm

Hi,
I added Register and Login button on the menu but it only works in the first install. Dont change after login.

Menu;
Image

Code;
Image

Newbie

Posts

Joined
Sat Feb 03, 2018 9:14 pm

Post by straightlight » Wed Feb 07, 2018 7:30 am

No OC version posted. In your admin - > dashboard page, clear all your OC cache as well from your admin - > extensions - > modifications - > refresh button. Then, refresh your store-front end noticing the changes for the register link.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by bybrkbzn » Wed Feb 07, 2018 10:32 pm

I'm using the 3.0.2.0 version. I'm making changes on the twig (catalog\view\theme\default\template\common\menu.twig) file.
I see login button but it don't see logout after login.
My menu.twig file:

Code: Select all

...
<ul class="nav navbar-nav" style='float:right'>
	{% if logged %}
		<li><a href="index.php?route=account/logout">{{ text_logout }}</a></li>
	{% else %}
		<li><a href="index.php?route=account/login">{{ text_login }}</a></li>
	{% endif %}
</ul>
...

Newbie

Posts

Joined
Sat Feb 03, 2018 9:14 pm

Post by straightlight » Thu Feb 08, 2018 7:07 am

The logged variable is not initialized from your catalog/controller/common/menu.php file which is why you cannot use it as such in the menu.twig file. All must be coded from each controller source file before using them back into the TPL / twig files.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by bybrkbzn » Fri Feb 09, 2018 2:16 am

Thank you so much, the problem was solved ;)

Newbie

Posts

Joined
Sat Feb 03, 2018 9:14 pm

Post by golki0887 » Wed Nov 23, 2022 6:29 am

Please show how and where to initialize $logged. I'm a total newbie to web dev and im learning thru opencart development. Thank you in advance!

Newbie

Posts

Joined
Sun Jun 20, 2021 8:39 am
Who is online

Users browsing this forum: No registered users and 52 guests