Community Forums

How to check if a module is active from template

Template support & advice for OpenCart v1.x

How to check if a module is active from template

Postby yakideo » Mon Jan 02, 2012 7:26 pm

Hello,

I was wondering if there is a way to detect if an template is active or inactive from a template. For example there is no need to show the affiliate link if the affiliate module is disabled.

opencart 1.5.1.3
yakideo
 
Posts: 3
Joined: Mon Jan 02, 2012 7:22 pm

Re: How to check if a module is active from template

Postby Qphoria » Tue Jan 03, 2012 8:37 am

You check the same way as you do from any location

Code: Select all
<?php if ($this->config->get('modulename_status')) { ?>
   ....do something
<?php } ?>
ImageImage
Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
User avatar
Qphoria
Administrator
 
Posts: 19127
Joined: Mon Jul 21, 2008 2:02 pm
Donate to Qphoria

Re: How to check if a module is active from template

Postby yakideo » Tue Jan 03, 2012 10:08 pm

Qphoria wrote:You check the same way as you do from any location

Code: Select all
<?php if ($this->config->get('modulename_status')) { ?>
   ....do something
<?php } ?>


Where can one find the name of the module?
I tried
Code: Select all
$this->config->get('affiliate_status')
but it returned NULL.
yakideo
 
Posts: 3
Joined: Mon Jan 02, 2012 7:22 pm


Return to Template Support

Who is online

Users browsing this forum: No registered users and 20 guests

Hosted by Arvixe Web Hosting