Post by outdoordecalsop » Sun Nov 28, 2021 4:12 am

Hello,
I tried to find a way to check admin user_group_id to render UI for specific admin user group.
I've tried just to add this variable to the view (order_list.twig), but it fails.

Code: Select all

                          {% if user_group.user_group_id === 1 %}
                          <li><a href="{{ order.order_id }}"><i class="fa fa-trash-o"></i> {{ button_delete }}</a></li>
                          {% endif %}
Could you give a hit how to import this variable?


Posts

Joined
Sat Nov 13, 2021 3:36 am

Post by straightlight » Sun Nov 28, 2021 4:20 am

outdoordecalsop wrote:
Sun Nov 28, 2021 4:12 am
Hello,
I tried to find a way to check admin user_group_id to render UI for specific admin user group.
I've tried just to add this variable to the view (order_list.twig), but it fails.

Code: Select all

                          {% if user_group.user_group_id === 1 %}
                          <li><a href="{{ order.order_id }}"><i class="fa fa-trash-o"></i> {{ button_delete }}</a></li>
                          {% endif %}
Could you give a hit how to import this variable?
With the use of an Event Trigger, this can be accomplished: https://github.com/opencart/opencart/wiki/Events-System

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 paulfeakins » Mon Nov 29, 2021 7:43 pm

straightlight wrote:
Sun Nov 28, 2021 4:20 am
With the use of an Event Trigger, this can be accomplished: https://github.com/opencart/opencart/wiki/Events-System
You think using an Event is the best way to pass data from a controller to a view these days?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by straightlight » Tue Nov 30, 2021 6:05 am

paulfeakins wrote:
Mon Nov 29, 2021 7:43 pm
straightlight wrote:
Sun Nov 28, 2021 4:20 am
With the use of an Event Trigger, this can be accomplished: https://github.com/opencart/opencart/wiki/Events-System
You think using an Event is the best way to pass data from a controller to a view these days?
As part as the platform is concerned to use Event Triggers as an Engine, it still is.

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
Who is online

Users browsing this forum: alanjones and 91 guests