Post by impairedspook » Sat Mar 26, 2016 10:24 am

Hi all,

I am trying to hide/remove the "Affiliates" module from the module list in admin. The only way I have found so far is to go to admin/controller/module and rename affiliate.php to affiliate.php_. This then removes it from my module list without deleting any files however I was wondering if there was a way to do this using VQMod instead?

I would rather try to limit how many core files I edit without using VQMod and was thinking there may be another way to do this?

Any help is appreciated.

Cheers

Active Member

Posts

Joined
Sat Apr 26, 2014 4:44 am

Post by ocart777 » Sat Mar 26, 2016 11:51 am

admin/controller/extension/module.php
search for

Code: Select all

$files = glob(DIR_APPLICATION . 'controller/module/*.php');
replace with

Code: Select all

$files = preg_grep("/(?=.*affiliate).*/", glob(DIR_APPLICATION . 'controller/module/*.php'), PREG_GREP_INVERT);
it is better to use vqmod for this so you don't have to edit the core file directly
if you want to hide some other module eg banner, add "|(?=.*banner)" after the "(?=.*affiliate)".
the operator | is used to check if affiliate or banner is there, the same as "xor"

PREG_GREP_INVERT, invert the return value
Last edited by ocart777 on Sat Mar 26, 2016 3:18 pm, edited 1 time in total.

You can't control the weather, but you can change your mood.
You can't modify the visage, but you can show your smile.
You can't command someone else, but you can hold yourself.
You can't forecast tomorrow, but you can using today.
You can't obtain thanks, but you can exert yourself in everything.


OCEXTENSION.COM - YOUR PROFESSIONAL OPENCART EXTENSION STORE


User avatar
Active Member

Posts

Joined
Mon Jun 10, 2013 4:57 pm
Location - Malaysia

Post by impairedspook » Sat Mar 26, 2016 12:01 pm

Awesome thanks ocart777, however it seems to remove "account" and "affiliate". Mind you at least I know where I am looking now :)

If you can spot what is off that would be good otherwise I will have a play around and see if I can get it sorted.

Appreciate the help!

UPDATE: Seems that if I change [!affiliate] to [!account] i will still lose both. Must be the A's :)

Active Member

Posts

Joined
Sat Apr 26, 2014 4:44 am

Post by ocart777 » Sat Mar 26, 2016 3:19 pm

i've update my previous post. please check it out

You can't control the weather, but you can change your mood.
You can't modify the visage, but you can show your smile.
You can't command someone else, but you can hold yourself.
You can't forecast tomorrow, but you can using today.
You can't obtain thanks, but you can exert yourself in everything.


OCEXTENSION.COM - YOUR PROFESSIONAL OPENCART EXTENSION STORE


User avatar
Active Member

Posts

Joined
Mon Jun 10, 2013 4:57 pm
Location - Malaysia

Post by impairedspook » Sat Mar 26, 2016 8:01 pm

Thanks ocart777, That did the trick :) Appreciate the help!

Active Member

Posts

Joined
Sat Apr 26, 2014 4:44 am
Who is online

Users browsing this forum: No registered users and 21 guests