Get Store code by Store id programmatically magento 2.

You can get Store code by Store id programmatically using Magento 2.

Many times, you have Store id available but you have to fetch Store code based on id, You need to use StoreManagerInterface interface.

You can fetch current Store code by below code snippet, Continue reading “Get Store code by Store id programmatically magento 2.”

Get Website code by website id programmatically magento 2.

Retrieve website code by website id programmatically using Magento 2.

Many times, you have website id available but you have to fetch website code based on id, You need to use the StoreManagerInterface interface.

You can fetch current website code by below code snippet, Continue reading “Get Website code by website id programmatically magento 2.”

Get Credit memo details by order increment id Magento 2.

You can fetch the Credit memo collection details by Order Increment Id using Magento 2.

When you check the sales_creditmemo table, order_id available in sales_creditmemo table so you first fetch the order entity id from the order increment id.

To get credit memo records, you first fetch the order id by order increment id and pass order id as SearchCriteriaBuilder addFilter() method. Continue reading “Get Credit memo details by order increment id Magento 2.”