How To Hidden Product Image By A Logo "member Only"

Hi, some one can help me how to hidden the product image with a logo " member only", because we don’t want unregister customer see the product images on the each category pages, but not apply this function on the home pages, only for the category pages.



My website have the multi vendor version 4.0



Thanks

Hi @enewmall,

The modification is similar with [url=“Hide Product Code in the Frontend - Free CS-Cart Add-on by HungryWeb.net”]http://www.hungryweb.net/cs-cart-addons/hide-product-code-in-the-frontend.html[/url]



If you need help you are always welcome to contact us here [url=“CS-Cart Free Add-ons, Modules and Custom Development | Hungryweb”]CS-Cart Free Add-ons, Modules and Custom Development | Hungryweb



Keep on smiling,





Valentin

[color=#808080][size=2]part of hungryweb.net[/size][/color]

[quote name='enewmall' timestamp='1417813639' post='198891']

Hi, some one can help me how to hidden the product image with a logo " member only", because we don't want unregister customer see the product images on the each category pages, but not apply this function on the home pages, only for the category pages.



My website have the multi vendor version 4.0



Thanks

[/quote]


  1. Create “func.php” file in “app/addons/my_changes” with this content:


```php


use Tygh\Registry;

if (!defined('BOOTSTRAP')) { die('Access denied'); }

function fn_my_changes_gather_additional_products_data_pre($products, &$params) {
if (Registry::get('runtime.controller') == 'categories') {
$params['get_icon'] = false;
$params['get_detailed'] = false;
$params['get_additional'] = false;
}

return true;
}
```


2. Create "init.php" file in "app/addons/my_changes" with this content:

```php

if (!defined('BOOTSTRAP')) { die('Access denied'); }

fn_register_hooks(
'gather_additional_products_data_pre'
);
```

3. Don't forget enable My changes add-on.

[color=#282828][font=arial, verdana, tahoma, sans-serif]Best regards,[/font][/color]
[color=#282828][font=arial, verdana, tahoma, sans-serif]Leonid[/font][/color]
[color=#282828][font=arial, verdana, tahoma, sans-serif]Chief Technology Officer of CSExperts[/font][/color][color=#282828][font=arial, verdana, tahoma, sans-serif] [/font][/color]

[quote name='csexperts' timestamp='1417855198' post='198924']

  1. Create “func.php” file in “app/addons/my_changes” with this content:


```php


use Tygh\Registry;

if (!defined('BOOTSTRAP')) { die('Access denied'); }

function fn_my_changes_gather_additional_products_data_pre($products, &$params) {
if (Registry::get('runtime.controller') == 'categories') {
$params['get_icon'] = false;
$params['get_detailed'] = false;
$params['get_additional'] = false;
}

return true;
}
```


2. Create "init.php" file in "app/addons/my_changes" with this content:

```php

if (!defined('BOOTSTRAP')) { die('Access denied'); }

fn_register_hooks(
'gather_additional_products_data_pre'
);
```

3. Don't forget enable My changes add-on.

[color=#282828][font=arial, verdana, tahoma, sans-serif]Best regards,[/font][/color]
[color=#282828][font=arial, verdana, tahoma, sans-serif]Leonid[/font][/color]
[color=#282828][font=arial, verdana, tahoma, sans-serif]Chief Technology Officer of CSExperts[/font][/color][color=#282828][font=arial, verdana, tahoma, sans-serif] [/font][/color]
[/quote]
Super, thank very much. let me try.

I think that the correct content of the func.php file should be


```php

use Tygh\Registry;
if (!defined('BOOTSTRAP')) { die('Access denied'); }
function fn_my_changes_gather_additional_products_data_pre($products, &$params) {
if (Registry::get('runtime.controller') == 'categories' && empty($_SESSION['auth']['user_id'])) {
$params['get_icon'] = false;
$params['get_detailed'] = false;
$params['get_additional'] = false;
}

return true;
}
```

In other case, the images will be hidden for all visitors.

eComLabs,



You're right! You are very careful! Thank you.



[color=#282828][font=arial, verdana, tahoma, sans-serif]Best regards,[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]Leonid[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]Chief Technology Officer of CSExperts[/font][/color][color=#282828][font=arial, verdana, tahoma, sans-serif] [/font][/color]