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

Get order id by increment id Magento 2

In this article, I will show you how you can load order by increment id in Magento 2 We can use the order interface Magento\Sales\Api\Data\OrderInterface to load order by increment id. By Object Manager: $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $incrementId = "100009633"; $orderInterface = $objectManager->create('Magento\Sales\Api\Data\OrderInterface'); $order = $orderInterface->loadByIncrementId($incrementId); // Print Order Object print_r($order->debug()); // Get Order Id…

Continue Reading Get order id by increment id Magento 2

How to get a formatted price with currency in phtml file in Magento 2

In this article, I will show you how you can get the formatted price with currency. You can get the formatted price with class Magento\Directory\Model or Magento\Framework\Pricing\PriceCurrencyInterface or Magento\Framework\Pricing\Helper\Data 1. By using class Magento\Framework\Pricing\Helper\Data The best way of doing this by using class Magento\Framework\Pricing\Helper\Data as a dependency. This class has two methods currency and currencyByStore.…

Continue Reading How to get a formatted price with currency in phtml file in Magento 2