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.
Odoo is the world's easiest all-in-one management software.
 It includes hundreds of business apps:
- CRM
- e-Commerce
- Бухоблік
- Склад
- PoS
- Project
- MRP
Це запитання позначене
            
                1
                
                    Відповісти
                
            
        
        
            
                2826
                
                    Переглядів
                
            
        
    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>
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Реєстрація| Related Posts | Відповіді | Переглядів | Дія | |
|---|---|---|---|---|
| 
            
                Remove Search Box on /shop page
            
            
                    Вирішено
            
         |  | 4 лист. 23  | 4004 | |
|  | 1 бер. 15  | 7529 | ||
|  | 1 бер. 15  | 6510 | ||
|  | 0 лист. 19  | 2956 | ||
|  | 2 бер. 24  | 2169 | 
