How to Convert Order to Invoice Programmatically in Magento 2?

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

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

Class Magento\Sales\Model\Convert\Order have toInvoice() function that will be useful to convert the order to 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?”

How to use selected_options and entered_options in GraphQL Query Magento 2?

What is the Difference between selected options vs entered options GraphQL keyword?
From the Magento version 2.4, You can see new architectural changes for the Data Transfer Object (DTO) will be used widely in GraphQL Query.

You have also marked new updates selected_options and entered_options in the GraphQL Query.

selected and entered options value must be base64_encode in the query and you can use this feature in add to cart and wishlist by GraphQL mutation. Continue reading “How to use selected_options and entered_options in GraphQL Query Magento 2?”