Skip to main content
Odoo Community Association

Website Snippet Product Category

Beta License: LGPL-3 OCA/e-commerce Translate me on Weblate Try me on Runboat

Adds a new snippet to show e-commerce categories.

A category is only displayed if it and all of its parent categories are explicitly enabled for the snippet, and can optionally be restricted to selected websites.

Table of contents

Configuration

You can select what categories can be shown by the snippet and an image for the category:

  1. Go to website > eCommerce > eCommerce Categories

  2. Create or Edit one

  3. You can see a new options “Published in product category snippet”

  4. You can also set “Websites for category snippet” to restrict where the category is shown in the snippet. Leave it empty to show it on all websites.

Usage

  1. Go to website (frontend)

  2. Press ‘Edit’ button

  3. Drag the ‘Product Category’ snippet to the place of the website that you want

  4. Save changes

Theming

CSS Classes:

  • .categ_container > The container per master category

  • .categ_scroll_wrapper > The scrollable container wrapper

  • .categ_scroll > The scrollable container

  • .categ_tree_level > The category row (image + text)

  • .main_tree_level > The first category row level displayed

  • .categ_link > The link of the category row

  • .categ_img > The container of the icon of the category row

You can use ‘data-tree-level’ attribute to select the category row of a selected level (1-4 by design).

Also you can replace the entire template by setting the data-template attribute directly on the .js_product_category element, e.g. by inheriting the view where the snippet is placed:

<xpath expr="//div[hasclass('js_product_category')]" position="attributes">
    <attribute name="data-template">my_module.my_custom_template</attribute>
</xpath>

You only need know that the name of the variable that have all the categories is called object.

Known issues / Roadmap

  • The snippet shows a maximum of 4 levels by design.

  • Add a option to configure the initial level

  • Add a option to select how many levels can be represented

  • Handle large amounts of categories

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits

Authors

  • Tecnativa

Contributors

  • Tecnativa:

    • Alexandre D. Díaz

    • Pedro M. Baeza

    • Carlos Roca

    • Sergio Teruel

    • Pilar Vargas

Other credits

static/img/boxes_32.png - https://www.iconninja.com/box-mario-icon-30561

Maintainers

This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

Current maintainer:

Tardo

This module is part of the OCA/e-commerce project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

Release files for odoo-addon-website-snippet-product-category 19.0.1.0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for odoo-addon-website-snippet-product-category 19.0.1.0.0.2
File Interpreter ABI Platform
odoo_addon_website_snippet_product_category-19.0.1.0.0.2-py3-none-any.whl Python 3 none any Details

Release files / odoo_addon_website_snippet_product_category-19.0.1.0.0.2-py3-none-any.whl

Download URL odoo_addon_website_snippet_product_category-19.0.1.0.0.2-py3-none-any.whl
Size 43.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
037f5960f88fd3b1107c30afa0d1cac587c184d1734e4e55016adaab786a3e1d
BLAKE2b-256 checksum
How to use checksums
04e278f34862435318c6e7b453dc9bf73b2eb715252d2ecc4562edeed2a799d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page