Skip to main content

Links between Secondary Category Module and Other Modules

This document showcases the module links defined between the Secondary Category Module and other Commerce Modules.

Summary

The Secondary Category Module has the following links to other modules:
First Data ModelSecond Data ModelTypeDescription
ProductSecondaryCategoryStored - many-to-manyAssociates products with secondary categories for additional organization

Product Module

Mercur defines a link between the Product Module’s Product data model and the Secondary Category Module’s SecondaryCategory data model. This allows products to be organized under secondary categories in addition to their primary category, enabling more flexible product categorization and navigation.

Retrieve with Query

To retrieve the secondary categories of a product with Query, pass secondary_category.* in fields:
  • query.graph
  • useQueryGraphStep
const { data: products } = await query.graph({
  entity: "product",
  fields: [
    "*",
    "secondary_category.*",
  ],
})

// products[0].secondary_category
To manage the secondary categories of a product, use Link: