Magento 2 API: Add Products to Cart & Checkout Place Order

In this article, we will look into how we can add products to the cart and complete the checkout process by placing an order using Magento API. The APIs used to create a cart, add products to the cart, place an order, etc. require customer token authentication. Create Shopping Cart We create an empty cart … Read more

Magento 2: Search Repository using SearchCriteriaBuilder, Filter & FilterGroup

This article shows how we can search Magento Repositories using SearchCriteriaBuilder that implements SearchCriteriaInterface. An example is provided of how we can perform search on Product repository in Magento. Similarly, we can search for other entities like Category, Customer, Order, Invoice, CMS Page, CMS Block, etc. We can add different conditions to build custom search … Read more

Magento 2: Recent Order not showing in Sales Order Grid

You place an order from frontend and expect it to be displayed in the Sales -> Orders grid in the Magento backend. But, you don’t see your recent order in the sales order grid. Cause This is because Magento uses Scheduled Grid Updates. The order related grids (order, invoice, shipment, credit memo) are updated via … Read more

Magento 2: Change Increment ID Prefix, Suffix, Start value, Step, Pad length of Order, Invoice, Creditmemo & Shipment

This article shows how you can change/update the Order Increment ID, Invoice Increment ID, Creditmemo Increment ID, Shipment Increment ID of your Magento 2 store. In Magento 1, you could simply change the increment prefix and last increment id from the database table entity_store_id. In Magento 2, it’s different. You have the option to change … Read more

Magento 2: Get Order Info, Order Item, Payment Info, Billing Address & Shipping Address by Order ID & Increment ID

This article shows how you can get order information by loading the order by order id or order increment id. We will load the order by order id and also with order increment id. Then, we fetch the following information: – Order details – Order Items Information – Payment information of the Order – Billing … Read more

MailChimp API v3.0 – Add Store to List, Add Product to Store, Add Order to Campaign

This article shows how you can use MailChimp API v3.0 with PHP and CURL to add ecommerce data to your MailChimp campaign. When purchases happen in your shop then you can add your purchase order data to MailChimp to track purchases from your MailChimp Campaign. A MailChimp campaign is associated to any particular MailChimp list. … Read more

Magento: Add New Column to Sales Order Grid in Admin

This article shows how you can add new columns to sales order grid in Magento 1.x admin. For this, you need to rewrite/override the Adminhtml’s sales_order_gird block class. Here is the block override code to be written in your module’s config.xml file: YourCompany/YourModule/etc/config.xml <global> <blocks> <yourmodule> <class>YourCompany_YourModule_Block</class> </yourmodule> <adminhtml> <rewrite> <sales_order_grid>YourCompany_YourModule_Block_Adminhtml_Sales_Order_Grid</sales_order_grid> </rewrite> </adminhtml> </blocks> </global> … Read more

Magento: Create Order Programmatically

This article show how you can create sales order programmatically through code in Magento 1.x. This code example also includes creating new customer if the customer email is not already registered. It also shows how you can save customer address to the newly created customer. This code has been tested for simple products. Here are … Read more

Magento 2: Get Product’s Custom Option Value from Cart & Order

This article shows how to get custom option values of products/items added to cart or products of any order in Magento 2. I will simply be using ObjectManager for this example. Get custom options of products present in shopping cart $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $cart = $objectManager->get('\Magento\Checkout\Model\Cart'); // get cart items $items = $cart->getItems(); // get … Read more