Magento 2 reindexer stuck on processing status.

Run this below query on magento 2 database. update indexer_state set status = 'invalid' where indexer_id = 'indexer_id_nam...
Read More

Get total execution time of any PHP Script.

Using this below script we can easily calculate execution time of php script. $time_start = microtime(true); // Add script which tim...
Read More

Magento 2 print log with zend library

We can easily print log in magento 2 using below code on any controller, Model, Plugins, Helper. $writer = new \Zend\Log\Writer\Stream...
Read More

Magento 2 get shipping and billing address by order id

Check below code snippet to get shipping and billing address of order by order id. $orderid = 2; $objectManager = \Magento\Framew...
Read More

Magento 2 get customer information by order id

We can get customer information of particular order by order id using below code. $orderid = 2; $objectManager = \Magento\Framework...
Read More

Magento 2 get order payment information by order id programmatically

We can get order payment information data by order id using below code snippet. $orderid = 2; $objectManager = \Magento\Framework\App...
Read More

How to run magento-2 script in root with custom php file

Using below code snippet you can run any magento 2 script in custom php file. so create a custom php file like test.php in root folder w...
Read More

PHP Condition to check space is available or not between two or more words

Using below code we can get that space is available or not btween two or more words. $str = 'Hello World!'; if ($str == trim($...
Read More