How to get custom image type attribute value from product magento 2?

We can able to fetch the Custom Image Type product attribute value from the Product object by just fetching the product object.

Let’s say you have created a custom image_type product attribute called, brand_logo and you want to fetch the value saved for a product by product object. You can refer to the below logic to fetch the image value.

You can fetch the value of the image attribute by calling the below line,

I hope you have fetched the Product Object by the ProductRepositoryInterface, You can check the logic, Fetch Product Object By SKU

$product->getData('brand_logo');

Using the above stuff, You will get the file path of the image in the response.

How to get Product Stock Item by REST API V1/stockItems/:SKU Magento 2?

You can fetch product stock-related data like Qty, status, manage stock by REST API V1/stockItems/:SKU

URL: <BASE_URL>/rest/V1/stockItems/:SKU (https://magento246.test/rest/V1/stockItems/MySku)

Header: Authorization:Bearer <ADMIN_TOKEN> Continue reading “How to get Product Stock Item by REST API V1/stockItems/:SKU Magento 2?”

GraphQl Create Empty cart for registered customer Magento 2.

To Create an Empty cart for a logged-in customer by GraphQl in Magento, you need to use Mutation to generate a cart id.

The Response of the createEmptyCart GraphQl mutation used for the add item to the customer cart by passing cart Id in addProductsToCart Mutation. Continue reading “GraphQl Create Empty cart for registered customer Magento 2.”