Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
2803 Weergaven

I think a better User Experience is to take them straight to the product instead of returning a list of search results with a single product in the list.

Avatar
Annuleer
Beste antwoord

You can redirect the search results page to the product page if there is one match:

Create a new view to inherit and override the default by injecting the redirect at the start of the search results page:


This also sets the body of the page to nothing, so you don't see the results page render.  If you can live with the page refresh, this might be a solution for you.

Code:

<t t-call="website.layout" position="before">
<t t-if="bins and len(bins[0]) == 1">
<style type="text/css">body { display: none; } </style>
<meta http-equiv="refresh" t-attf-content="0;url=/shop/product/{{ bins[0][0]['product'].id }}" />
</t>
</t>
Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
4
nov. 23
3964
1
mrt. 15
7516
1
mrt. 15
6493
0
nov. 19
2946
2
mrt. 24
2150