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 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 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 order by shipment id. We can use the default Magento_InventoryShipping class Magento\InventoryShipping\Model\ResourceModel\ShipmentSource\GetSourceCodeByShipmentId Here is the sample code: <?php namespace Mageprince\Test\Model; use Magento\InventoryShipping\Model\ResourceModel\ShipmentSource\GetSourceCodeByShipmentId; class SampleClass { protected $filter; public function __construct( ... GetSourceCodeByShipmentId $sourceCodeByShipmentId, ... ) { $this->sourceCodeByShipmentId…

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

Create short forms of Magento 2 commands in Linux

During development with Magento 2, we need to run the command repeatedly. And each time we need to type bin/magento command. In this article, I will show you how you can create short forms of Magento 2 commands in Linux. For example, you can clean the cache by only typing c:c without php bin/magento cache:clean…

Continue Reading Create short forms of Magento 2 commands in Linux