Skip to content

Latest commit

 

History

History
147 lines (106 loc) · 3.68 KB

catalog_category.md

File metadata and controls

147 lines (106 loc) · 3.68 KB

Catalog Category

Retrieve the list of products assigned to a required category.

magento.catalogCategory.assignedProducts({
  categoryId: val
}, callback);

Create a new category and return its ID.

magento.catalogCategory.assignProduct({
  categoryId: val,
  product:    val,
  position:   val   /* optional */
}, callback);

Create a new category and return its ID.

data is a catalogCategoryEntityCreate object.

magento.catalogCategory.create({
  categoryId: val,
  data:       val,
  storeView:  val   /* optional */
}, callback);

Allows you to set/get the current store view.

magento.catalogCategory.currentStore({
  storeView: val
}, callback);

Allows you to delete the required category.

magento.catalogCategory.delete({
  categoryId: val
}, callback);

Allows you to retrieve information about the required category.

magento.catalogCategory.info({
  categoryId: val,
  storeView:  val,  /* optional */
  attributes: val   /* optional */
}, callback);

Allows you to retrieve one level of categories by a website, a store view, or a parent category.

magento.catalogCategory.level(callback);

// or

magento.catalogCategory.level({
  website:        val,  /* optional */
  storeView:      val,  /* optional */
  parentCategory: val   /* optional */
}, callback);

Allows you to move the required category in the category tree.

magento.catalogCategory.move({
  categoryId: val,
  parentId:   val,
  afterId:    val   /* optional */
}, callback);

Allows you to remove the product assignment from the category.

magento.catalogCategory.removeProduct({
  categoryId: val,
  productId:   val
}, callback);

Allows you to retrieve the hierarchical tree of categories.

magento.catalogCategory.tree(callback);

// or

magento.catalogCategory.tree({
  parentId:   val,  /* optional */
  storeView:  val  /* optional */
}, callback);

Update the required category. Note that you should specify only those parameters which you want to be updated.

magento.catalogCategory.update({
  categoryId:   val,
  categoryData: val,
  storeView:    val   /* optional */
}, callback);

Allows you to update the product assigned to a category. The product position is updated.

magento.catalogCategory.updateProduct({
  categoryId: val,
  productId:  val,
  position:   val   /* optional */
}, callback);