콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
2788 화면

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.

아바타
취소
베스트 답변

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>
아바타
취소
관련 게시물 답글 화면 활동
4
11월 23
3962
1
3월 15
7510
1
3월 15
6478
0
11월 19
2944
2
3월 24
2144