Modifying and displaying product list if logged in, + others criterias

Fragen und Antworten zu Darstellungsvorgaben

Modifying and displaying product list if logged in, + others criterias

Beitragvon vmulot » 21. Mai 2015, 16:21

Hello,

i have got a new question for product displaying.
Some of the products don't have a price or at least have 0.0000 because they are very specific.

If customers aren't logged in, it's fine, all products are here even if price is at 0.0000

If customer is logged in, i need to "filter" product list, so he can't see/access product with price at 0.0000, even when performing a search.

any idea ?

atm i'm using a hook you gave me "myBeforeProductlistOutputBeforePagination".
but when doing a search, or if i know the product url, i can see it.

any how to ? suggestions ? is it posible ?

thanks!
regards
vmulot
 
Beiträge: 46
Registriert: 5. Nov 2014, 15:26

Re: Modifying and displaying product list if logged in, + others criterias

Beitragvon supportteam2 » 22. Mai 2015, 00:04

I'm not sure if I understand correctly. I assume that you managed to filter out the products that you want to hide, using the hook "myBeforeProductlistOutputBeforePagination" but if someone knows the exact url to the product, he can open the url and see the product that you don't want to show him. If the user doesn't know the url he might still find the product using the standard contao search (not the Merconis product search because in this case your custom filter logic comes into play).

Did I get it right? If so, the problem only exists with product detail pages. Product overview pages should not display the products that you want to hide, because the hook works there.

I would suggest that you add some code to the product details template to check if the user is logged in and if there's a reason not to display the product. In this case you could hide the actual product information and show some sort of message or you could redirect to another page, maybe the 404 error page.

It's probably a little bit "cleaner" to use the hook "beforeProductSingleviewOutput" to figure out if a product must not be displayed and then redirect to an error page but doing it in the product details template is much easier so I strongly suggest that you do it there.
Ihr MERCONIS-Supportteam
Your MERCONIS Support Team
Benutzeravatar
supportteam2
 
Beiträge: 411
Registriert: 4. Mär 2015, 14:05

Re: Modifying and displaying product list if logged in, + others criterias

Beitragvon vmulot » 22. Mai 2015, 08:25

Ok, that's what i was thinking, thanks for helping !
vmulot
 
Beiträge: 46
Registriert: 5. Nov 2014, 15:26


Zurück zu Darstellungsvorgaben / Display settings

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 0 Gäste