Taxonomies and taxons provide a robust way to classify and categorize products.
They belong to the
Administrators can define as many structures as they need from Solidus's
backend. Then, they can associate individual products with any number of
taxonomies or taxons using the
Use taxonomies to define the ways that you want to classify products in your store at a high level. They are the parent nodes for taxons.
The following taxonomies are common in ecommerce stores:
Once the taxonomies have been established, you can start to break down the lower-level organization by adding child nodes, called taxons.
For example, if you decide to create
Brands as taxons, your
taxonomies might look like this:
Categories |-- Luggage |-- Clothing |-- T-shirts |-- Socks |-- Shoes Brands |-- Adidas |-- Bentley |-- Calvin Klein
Taxons can have child taxons. For example, a
Clothing taxon may have further
Spree::Products become associated with taxons through the
This model exists so that if a product is deleted, all of the links from that product to its taxons are also deleted. A similar action takes place when a taxon is deleted: all of the links to products are deleted automatically.
Linking to a taxon in a controller or a template should be done using the
spree.nested_taxons_path helper, which uses the taxon's permalink to
generate a URL such as
Taxons use the Nested set model for their hierarchy.
rgt properties on the
Spree::Taxons model represent the
locations within the hierarchy of the item. This logic is handled by the
awesome_nested_set gem. See
the gem's documentation
for more information about these fields.
Solidus is an open source platform supported by the community. We encourage everyone using Solidus to contribute back to the documentation and the code.
If you’re interested in contributing to the docs, get started with the contributing guidelines. If you see something that needs fixing and can’t do it yourself, please send us an email.