Skip to content

Latest commit

 

History

History
89 lines (64 loc) · 2.48 KB

catalog_product_attribute_media.md

File metadata and controls

89 lines (64 loc) · 2.48 KB

Catalog Product Attribute Media

Allows you to upload a new product image.

data is a catalogProductAttributeMediaCreateEntity object.

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

Allows you to set/get the current store view.

magento.catalogProductAttributeMedia.currentStore(callback);

// or

magento.catalogProductAttributeMedia.currentStore({
  storeView: val    /* optional */
}, callback);

Allows you to retrieve information about the specified product image.

magento.catalogProductAttributeMedia.info({
  info:       val,
  file:       val,
  storeView:  val   /* optional */
}, callback);

Allows you to retrieve the list of product images.

magento.catalogProductAttributeMedia.list({
  product:    val,
  storeView:  val   /* optional */
}, callback);

Allows you to remove the image from a product.

magento.catalogProductAttributeMedia.remove({
  product:  val,
  file:     val
}, callback);

Allows you to retrieve product image types including standard image, small_image, thumbnail, etc.

Note that if the product attribute set contains attributes of the Media Image type (Catalog Input Type for Store Owner > Media Image), it will also be returned in the response.

magento.catalogProductAttributeMedia.types({
  setId: val
}, callback);

Allows you to update the product image.

magento.catalogProductAttributeMedia.update({
  product:    val,
  file:       val,
  data:       val,
  storeView:  val
}, callback);