Enhancements in Website Module of Odoo V-14


The Client had a requirement to add an additional functionality to their website which is to show “Frequently bought products”. The client wanted us to show those products at the bottom of the shopping page which were most frequently bought by customers and sort them as per the quantity bought previously.

Solution / Approach:

Following technologies have been used to implement this additional functionality:

  1. Python for backend logic writing.
  2. Javascript for server-site scripting.
  3. XML for view.

Firstly, Snippet has been created with the help of XML for frontend view. Snippet is a technical term for a minor region of re-usable source code or machine code. For the website functionality, i.e. showing products at the bottom of the shopping page which were often bought by customers, Controllers were created which were written in Python. ‘Controllers’ are used to configure the frontend modules. These frontend modules come integrated with the backend modules.

For making it responsive and selection based, Javascript was used that helps controllers to render the page. Also, in the controllers file a filter was added that sets the limit of Frequently bought products to 10 such that it shows only the latest 10 frequently bought products which were bought by the customers.

There are various building blocks available for the product description and window customization which can be done by the user, based on the block operations, style and the options. Few of the options which are already available are Viewed Products, Products Search, Popup, Facebook, Form, Countdown, Google Map, Dynamic Products, etc.

So, a customized building block named “Frequently bought products” was developed. With the help of this building block users can simply drag and drop the block to the website and add quick functionality for the website.

With the help of XML a customized Toggle was also created which is shown on the top of the website page (Page, Customize, Promote). On clicking the customize button various toggle options are shown. So by turning the Frequently bought products toggle option on, Frequently bought products are added to the website.


Following is the screenshot of the website where the Frequently Bought Products are shown. These are the recently purchased products sorted by the mostly(quantity) purchased products showing first. Odoo Admins can show/hide this “Frequently Bought Products” block on screen by dragging it from the building block and also can control this block by the toggle option provided under Customize button.

Frequently Bought Products added in the image

For any query, contact support@astreait.com.