How to Get all products assigned to category by category id Magento 2.

You can retrieve all the products assigned to a specific category by category id in Magento 2.

Used interface:
Magento\Catalog\Api\CategoryLinkManagementInterface

Get Method from the interface to fetch a list of all the products, public function getAssignedProducts($categoryId); Continue reading “How to Get all products assigned to category by category id Magento 2.”

How to get all gallery images collection of the product Magento 2?

You can Retrieve the list of gallery image entries associated with given product by SKU value in Magento 2.

Using the ProductAttributeMediaGalleryManagement Interface, You can use getList($sku) method to achieve the all the media entry for the product. Continue reading “How to get all gallery images collection of the product Magento 2?”

How to Add/Update Special price of Product Magento 2?

You can Add or Update special price of the product by the SpecialPrice Interface. Catalog module contains the Special Price interface to update the special price of the product.

Base defination of the update special price of the product,
public function update(array $prices); Continue reading “How to Add/Update Special price of Product Magento 2?”