How to create order status and state programmatically in Magento 2?

You can create a custom order state and order status programmatically with the help of the class Magento\Sales\Model\Order\Status.

I have just created a new order status called processing_review and assigned the status to the processing state.

You need to create Datapatch to install the new status in Magento 2.
Just create Datapatch in your module setup folder, Continue reading “How to create order status and state programmatically in Magento 2?”

How to update Composer version by docker using PHP-CLI container?

You can update the composer version by Docker with the help of PHP CLI Container.

Let’s start by checking your docker available image with the help of command, docker ps.

You can see a list of available Container IDs with details of each IMAGE, and NAMES section. Continue reading “How to update Composer version by docker using PHP-CLI container?”

How to remove specific item from cart Magento 2?

You can delete specific quote items from the cart by quote id and item id in Magento 2.

With the help of Cart Item Interface, Magento\Quote\Api\CartItemRepositoryInterface you can use the deleteById() method.

Prerequisite to delete quote item:

          • Quote ID
          • Quote Item ID

Continue reading “How to remove specific item from cart Magento 2?”