cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

search restriction with the following parameters:

0 Kudos
1,621

Your system contains a search restriction with the following parameters: Type: Product User: anonymous Restriction: 1=0 There is a product "Candle" in the online catalog and a variant product "PinkCandle" in the online catalog. The system renders the Product Detail Page for Pink Candle using the following flexible search query: "SELECT {pk} FROM {VariantProduct} WHERE {code} = "PinkCandle".

What happens next? what is the Search Query Result?

View Entire Topic
sabahchelqi
Discoverer

The flexible search query returns an empty list as the final query is SELECT {pk} FROM {VariantProduct} WHERE {code} = "PinkCandle" AND 1 = 0; 

As 1 = 0 is False the the where clause returns also false even the PinkCandle exists on the online catalog.

Note: A search restriction applies to the item type and its subtypes.

Roberts_92
Newcomer
0 Kudos

What does 1 = 0 mean? And what would change if it would be User: customergroup? Would the result be the same?

EDIT:

I found the answer. So in case you will access product detail page with restriction:
Type: Product
User: anonymous
Restriction: 1=0

it will probably return 404 or product not found. 

Restriction describes that restriction works for Product type and all subtypes (including VariantProduct).
User field describes that this applies for anonymous customers.
Restriction field describes that it will always be false.

For example, if you are not logged in customer, accessing variant product on product detail page, you will see 404 or page not found, since in backed flexible search query will return empty result for that search.