inCategory

function, since version 1.3.0
categories: product, category

inCategory(productId, categoryId)

returns true, if product with id productId belongs to category categoryId. Category doesn’t have to be primary category.

Expected use case is in conditions - display only products belonging to specific category.

parameters

return type:

boolean

examples

inCategory(product.id, 5)          
inCategory(product.id, runtime.categoryFilter)

Related functions:

Update your privacy settings