Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

What are the steps for editing existing Web pages in Odoo 17

What Are The Steps For Editing Existing Web Pages In Odoo 17

Odoo 17’s web pages serve as a digital canvas on which businesses can build their online presence. The gateways through which visitors interact with your brand are these intricate tapestries of content, functionality, and design. The ability to alter pre-existing web pages is a valuable tool that you can use to achieve a variety of goals, such as captivating users with visually stunning product showcases, streamlining user experiences, or adding a distinctive flair to your website.

Exploring the Core of Web Pages in Odoo 17

The website module is the main component of Odoo’s web page management. It is a powerful tool that manages the appearance, features, and customization of your website. This module acts as the coordinator, combining the various components that give your web pages life.

Every page in Odoo 17 is important to the growth of your online story, and each plays a crucial role in bringing that story to life. These digital spaces—from the home page’s welcoming appearance to the product showcases, about us pages, and contact forms’ educational content—combine to form your online persona.

In addition to disseminating information, Odoo 17 web pages can collect user data via intuitive forms, promote interaction with captivating elements, and ease online transactions. These digital platforms’ adaptability enables you to produce captivating experiences that connect with your target audience.

The Seamless Online Shopping Journey: An Examination

Let’s look at a real-world example to show the transformative power of web page modification in Odoo 17: improving an e-commerce website’s home page to highlight best-selling products and alluring promotional offers.

The Odoo home page is initially blank, ready for your artistic input. But with a few calculated changes, you can turn this virtual space into an attention-grabbing display that draws users in and advances them through the sales funnel.

On the homepage, display items that are in high demand

To get things started, we’ll feature top-selling products prominently on the Homepage. In addition to sparking interest, it guides visitors towards popular products. We’ll write some custom code to create a function that sorts these products based on sales volume, then we’ll integrate it into the front end for a visually appealing display.

Request a free quote
from odoo import http
from odoo.http import request
from odoo.addons.website.controllers.main import Home
class Website(Home):
    @http.route('/', auth="public", website=True, sitemap=True)
    def index(self, **kw):
        products = request.env['product.template'].sudo().search([])
        for each in products:
            each.sales_count = 0
            each.top_selling = False
        orders = request.env['sale.order'].sudo().search([('state', 'in', ('sale', 'done'))])
        for order in orders:
            order_line = order.order_line
            for product in order_line:
                product.product_id.sales_count = product.product_id.sales_count + 1
            super(Website, self).index()
            website_product_ids = request.env['product.template'].sudo().search([('sales_count', '!=', 0)], order='sales_count desc', limit=4)
            website_product_ids.top_selling = True
            return request.render('website.homepage',
                                  {'website_product_ids': website_product_ids})

This bit of code retrieves the best-selling items from the website’s homepage and displays them there, according to how many sales they generated over a given period. template for a homepage.

You can inherit the website and add these best-selling products to the homepage. Make a template for the homepage and include a container with the ID wrap inside the div. Here’s an illustration of how to use a product cart view to show the top-selling items:





This post first appeared on Odoo Pricing Details, please read the originial post: here

Share the post

What are the steps for editing existing Web pages in Odoo 17

×