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 Convert Order to Invoice Programmatically in Magento 2?

We can convert the order to an invoice using programmatically from the Order object in Magento.

Prerequisite:
You must have a valid Order Object. To Retrieve the Order Object check the link, Get order data by id programmatically in Magento

Class Magento\Sales\Model\Convert\Order has toInvoice() function that will be useful to convert the order to an invoice in Magento. Continue reading “How to Convert Order to Invoice Programmatically in Magento 2?”

How to use send Email To Friend GraphQL mutation Magento 2?

Send Email to Friend GraphQL Mutation used to send emails to a specific recipient with product details and your message.

By Default Email to Friend Setting is disabled and you want to try to run mutation, the response will throw an error,  “Email to a Friend” is not enabled.

For functionality to works well, You must activate settings from the admin configuration,
Stores > Configuration > Catalog > Email to a friend > Enabled Yes
Save Config.

Continue reading “How to use send Email To Friend GraphQL mutation Magento 2?”