How to get Invoice comments list programmatically in Magento 2?

Magento gets all the comments for invoices by its Id to track for a given order payment stuff.

Invoice comments will be added by the Store admin representative from the backend for the invoice query.

Comments can be notified by customer email and also display in the frontend invoice section if the checkbox is checked by the admin when creating any new comments from the backend.

The class responsible for the fetch list of comments from the invoice, Magento\Sales\Api\InvoiceManagementInterface Continue reading “How to get Invoice comments list programmatically in Magento 2?”

How to remove Invoices link from the Order View page Front area Magento 2?

Order View Page in frontend Magento 2, Contains Multiple links related to Order flows like Invoice, shipment, and refunds.

If you want to remove the Invoices link from the Order detail page, Customer Dashboard, My Orders tab You need to override sales_order_info_links.xml file. Continue reading “How to remove Invoices link from the Order View page Front area Magento 2?”

Get Invoice details by order increment id programmatically Magento 2.

You can get the invoice data for the specific order by order increment id in Magento 2.

Using Magento\Sales\Api\InvoiceRepositoryInterface interface, you need to use getList() function to fetch no. of invoice by sales order increment id.

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

To get invoice records, you first fetch the order id by order increment id and pass order id as SearchCriteriaBuilder addfilter() method. Continue reading “Get Invoice details by order increment id programmatically Magento 2.”