Website Product Comparison
Side-by-side product comparison table with a shopper compare tray
Website Product Comparison lets shoppers pick a handful of products and compare them side by side straight from the storefront. A backend configuration decides which fields and attributes matter per category, a lightweight session-based tray tracks up to four products across the shop, and a dedicated comparison page renders a spec-sheet-style table that flags what actually differs.
Key Features
Comparable attributes per category
product.comparison.attribute defines, per product category (or universally when left empty), which product.template fields (price, weight, description...) or which variant attributes (Color, Size, Material...) become a row in the comparison table.
Optional comparison sections
Attributes can be grouped into named product.comparison.group sections (e.g. Pricing, Specifications) so the table reads like a real spec sheet instead of a flat list.
Category compatibility check
check_category_compatible in the framework-free engine blocks adding a product from a different category to the tray, returning a clear error instead of building a meaningless comparison.
Session-based compare tray
A lightweight tray (no login required) stored in the visitor's session lets shoppers add up to four products (MAX_COMPARE_PRODUCTS), remove any one, or clear the tray entirely, through public /shop/compare/add, /remove, /clear and /tray JSON endpoints.
Dedicated /shop/compare page
build_comparison_table renders the full side-by-side matrix grouped by section, with every row flagged as either a shared (common) value or a genuine difference so what actually distinguishes the products stands out.
Compare toggle on every product tile
A Compare button is wired into the shop grid and the product detail page, calling the tray endpoints with no page reload via static/src/js/website_product_comparison.js.
Field or attribute value resolution
get_value on product.comparison.attribute pulls either a raw product.template field or the joined names of a variant attribute's values, typed as text, number, yes/no or price for correct formatting.
Framework-free, unit-tested engine
The attribute matrix construction, common/difference detection, category-compatibility check and tray bookkeeping all live in services/comparison_logic.py, plain Python with no Odoo import, independently unit tested.
Use Cases
Screenshots
01 Attribute List
02 Attribute Form
03 Group List
04 Group Form
Why Choose This Module
Because the attribute matrix construction, the common-vs-different detection and the tray bookkeeping are all plain, unit-tested Python with no Odoo dependency, the comparison logic is fast, predictable and easy to extend with new value types or grouping rules, while the storefront layer stays a thin, real controller rather than a mock.
Specifications
- Compatible: Odoo 18.0 / 19.0
- License: OPL-1
- Languages: 35+
- Author: Pokutsoft
- Dependencies: website_sale
- Support: odoo@gencbaris.com
- Update date: 2026-07-13
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
eCommerce (website_sale)
• Website (website) • Discuss (mail) • Invoicing (account) |
| Lines of code | 985 |
| Technical Name |
website_product_comparison |
| License | OPL-1 |
| Website | https://pokutsoft.com/ |
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module