Want to block some functionality like the list of vendors in MVE using dispatch=companies.catalog
How can we block this for any user visiting the store but knows that he can access the Vendor List using this dispatch value?
Hi,
- create app/addons/my_changes/controllers/frontend/companies.pre.php
- add following code
```php
use Tygh\Registry;
use Tygh\Mailer;
if ($mode == 'catalog') {
return array(CONTROLLER_STATUS_NO_PAGE);
}
```
3. activate the "My changes" add-on
Thank you.
If you want to hide it for the specific administrators, it can be done with the user groups feature (check the Manage vendors and View vendors options):
[quote name='Alt-team' timestamp='1432627234' post='215772']
Hi,
- create app/addons/my_changes/controllers/frontend/companies.pre.php
- add following code
```php
use Tygh\Registry;
use Tygh\Mailer;
if ($mode == 'catalog') {
return array(CONTROLLER_STATUS_NO_PAGE);
}
```
3. activate the "My changes" add-on
Thank you.
[/quote]
This works wonders for us. Thanks to you
hi,
additional change is needed for breadcrumbs - please check “All vendors” link on vendor page
need to replace this line in “app/controllers/frontend/companies.php”:
fn_add_breadcrumb(__('all_vendors'), 'companies.catalog');
with this one:
//fn_add_breadcrumb(__('all_vendors'), 'companies.catalog');
or:
if (Registry::get('addons.my_changes.status') == 'D') {
fn_add_breadcrumb(__('all_vendors'), 'companies.catalog');
}
p.s. it is difficult to do the same via add-on files (because cs-cart has no standard function for deletion of breadcrumbs)
best regards,
WSA team
[quote name=‘Damir (WSA-team)’ timestamp=‘1432834651’ post=‘216226’]
hi,
additional change is needed for breadcrumbs - please check “All vendors” link on vendor page
need to replace this line in “app/controllers/frontend/companies.php”:
fn_add_breadcrumb(__('all_vendors'), 'companies.catalog');
```<br />
<br />
with this one:<br />
```php
//fn_add_breadcrumb(__('all_vendors'), 'companies.catalog');
```<br />
or:<br />
```php
<br />
if (Registry::get('addons.my_changes.status') == 'D') {<br />
fn_add_breadcrumb(__('all_vendors'), 'companies.catalog');<br />
}<br />
```<br />
<br />
p.s. it is difficult to do the same via add-on files (because cs-cart has no standard function for deletion of breadcrumbs)<br />
<br />
best regards,<br />
WSA team<br />
[/quote]<br />
OK thats great. Thanks for the help Damir... Its really appreciated as always. <img src="upload://b6iczyK1ETUUqRUc4PAkX83GF2O.gif" class="bbc_emoticon" alt=":-)">