Jump to content

Hide restricted product on manufacturers page


Recommended Posts

Hi there its my first post so first of all wanna say hello to all :)

Okay now to my problem (don't know if im in good category) im using great plugin from NemoPS, Product Access FREE to have certain products only for premium group. Module works great but iv got manufacturer module on front page and when guest user enter manufacturer who has that premium product than he see that product, its restricted and can't enter to that product but I don't want that premium product to be seen on manufacturer list too. Is there any chance someone can help me? :)

I will be very grateful :) 

Thanks!

Share this post


Link to post
Share on other sites
52 minutes ago, ndiaga said:

Hi,

You  should  add the  restriction   in   the  manufacturer   template   by using  the id  group.

 

Yeah i tried to do "if" statement but im not good in php and second of all its not working so im doing something wrong :) there is something like $access_groups but if I tried

{if $access_groups['id_profile'] == 4}
	do something
else
	do something else
{/if}

where number 4 is id of premium group. 

Share this post


Link to post
Share on other sites
17 minutes ago, BartesPL said:

Yeah i tried to do "if" statement but im not good in php and second of all its not working so im doing something wrong :) there is something like $access_groups but if I tried


{if $access_groups['id_profile'] == 4}
	do something
else
	do something else
{/if}

where number 4 is id of premium group. 

Do   the  print_r   of  $access_groups   this  way  to get id_group  and  id_profile etc  :


<pre>{$access_groups|print_r}</pre>

 

Share this post


Link to post
Share on other sites
2 hours ago, BartesPL said:

Done that, and iv got printed one value


1

 of that product. Tried too $access_products['id_product'] but still always show 1

 

I  think  you should  ask    NemoPS  . 

Edited by ndiaga (see edit history)

Share this post


Link to post
Share on other sites

I used an override for the category, so you'll have to edit manufacturer.php, getProducts method.
Check the category.php override and see every place where I added this

                    ' AND pg.id_group '.(count($cgroups) ? 'IN ('.implode(',', $cgroups).')' : '= 1').

Unfortunately I had forgot to check that page back then, I thought it was covered by the product override but it wasn't, sorry for that

Share this post


Link to post
Share on other sites
20 hours ago, NemoPS said:

I used an override for the category, so you'll have to edit manufacturer.php, getProducts method.
Check the category.php override and see every place where I added this

                    ' AND pg.id_group '.(count($cgroups) ? 'IN ('.implode(',', $cgroups).')' : '= 1').

Unfortunately I had forgot to check that page back then, I thought it was covered by the product override but it wasn't, sorry for that

NemoPS thank you for your answer :) whoa ill try to do that by myself we will see if I handle it by myself :P 

P.S. maybe it working with standard manufacturer module. But template what I bought is using other module for manufacturers, so maybe there is a problem.

 

Edited by BartesPL (see edit history)

Share this post


Link to post
Share on other sites

Sorry for post bump.

20 hours ago, NemoPS said:

I used an override for the category, so you'll have to edit manufacturer.php, getProducts method.
Check the category.php override and see every place where I added this

                    ' AND pg.id_group '.(count($cgroups) ? 'IN ('.implode(',', $cgroups).')' : '= 1').

Unfortunately I had forgot to check that page back then, I thought it was covered by the product override but it wasn't, sorry for that

Well i tried to get it done but my php knowledge is maybe little more than basics. Is there any chance You can help me NemoPS? 

I found in your module category.php those lines you mention and I found getProducts in classes/Manufacturer.php.  But what to do with that?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More