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: Quick way to create order invoice programmatically

Here is a quick and easy way to create order invoice programmatically. Suppose, $_order contains your order. Here goes the code to create invoice:- if($_order->canInvoice()) { /** * Create invoice * The invoice will be in 'Pending' state */ $invoiceId = Mage::getModel('sales/order_invoice_api') ->create($_order->getIncrementId(), array()); $invoice = Mage::getModel('sales/order_invoice') ->loadByIncrementId($invoiceId); /** * Pay invoice * i.e. the … Read more