How to insert multiple records into a table without a model?

Hello folks, welcome back to my blog. In this article, I give you a sample code to insert multiple records into a table. Normally we use the repository, resource model to save records. But it will be good for a single record. If we have bulk data and save data with foreach it will become…

Continue Reading How to insert multiple records into a table without a model?

How to Get Product Salable Quantity By Stock Id in Magento 2

Hello Magento folks, welcome back to my new article about getting product salable quantity by stock id. There is lots of articles and stack exchange answer to get salable qty by SKU but here in this article, I will give you sample code to get salable qty by stock. We can use an interface Magento\InventorySalesApi\Api\GetProductSalableQtyInterface…

Continue Reading How to Get Product Salable Quantity By Stock Id in Magento 2

How to compress sales PDF size in Magento 2

Hello folks, welcome back to my new article about compress sales PDF file size. In default Magento, sales pdf size is approximately 3.2 MB. We can reduce the size to 3.5 KB only by changing the fonts of pdf. So you just need to override Magento pdf class for the invoice, shipment, and credit memo…

Continue Reading How to compress sales PDF size in Magento 2

How to increase file upload size in PHP

Are you a PHP developer or a system administrator managing servers that host PHP applications? Are you looking for a way to increase or set file upload size in PHP? If yes, then follow this article that shows you how to increase file upload size in PHP and also will explain some of PHP’s core…

Continue Reading How to increase file upload size in PHP

How to show source in shipment grid Magento 2 MSI

Hello Guys! Welcome back to another topic. Today I will show you how we can show supply source in shipment grid. With default Magento we can see Shipment number, Ship Date, Order, Order Date, Total Quantity etc. in shipment grid. To show the source of shipment we need to join inventory_shipment_source table to shipment grid…

Continue Reading How to show source in shipment grid Magento 2 MSI

How to Create Shipment Programmatically with Source Selection MSI Magento 2

Hello Guys! Welcome back to my blog. There are many tutorials and stack Exchange answers available for programmatically create a shipment in Magento 2. But today in this article I'll talk about how we can programmatically create a shipment in multi stock inventory MSI in Magento 2. For MSI we need to assign a source…

Continue Reading How to Create Shipment Programmatically with Source Selection MSI Magento 2

How to Add Custom Mass Action in Order Grid in Magento 2

Welcome back Magento Folks to my blog. In this article, I will show you how we can add new custom mass action to the order grid. The default Magento provides mass action like Cancel, Print, Delete, etc. We can easily add new mass action with UI components by two simple steps. Create sales_order_grid.xml in custom…

Continue Reading How to Add Custom Mass Action in Order Grid in Magento 2

How to get source by shipment Id in Magento 2 MSI

Hello guys! In this article, I will show you how we can get the assigned source of the shipment by shipment id. There are two way to get source by shipment id Method 1: We can use the Magento Inventory shipping class Magento\InventoryShipping\Model\ResourceModel\ShipmentSource\GetSourceCodeByShipmentId Method 2: Or by using Magento shipment repository Magento\Sales\Api\ShipmentRepositoryInterface Here is the…

Continue Reading How to get source by shipment Id in Magento 2 MSI

A QUICK WAY to print log or data in any PHP file in Magento 2

Hello Magento Folks, Welcome back to my learning blog. Today in this article I'm gonna show you a quick way to print log or print data in any PHP file in Magento 2. Warning: Use this trick only for development local branches don't use this to any production or live stores. xdebug is the most…

Continue Reading A QUICK WAY to print log or data in any PHP file in Magento 2

How to get category by url key in Magento 2

Sometime during custom development, we need to get category by category key. Recently in one project, I had a task to show category URL key instead of category id on layered navigation. So I need to get category id from url key. So here was my way. Here is the sample code to get category…

Continue Reading How to get category by url key in Magento 2