Query to get the top buyers in Magento 2

SELECT `sales_order`.`customer_id`, `email`, `firstname`, `lastname`, `telephone`, `street`, `city`, `region`, `company`, SUM(subtotal_invoiced) FROM (`sales_order` LEFT JOIN `sales_order_address` ON `sales_order`.`entity_id` = `sales_order_address`.`parent_id` AND `sales_order_address`.`address_type` = "billing") WHERE…

Standalone function get increment_id using order id

private static function getIncrementIDfromOrderID($orderID) { $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); // Instance of object manager $resource = $objectManager->get('Magento\Framework\App\ResourceConnection'); $connection = $resource->getConnection(); $tableName = $resource->getTableName('sales_order'); //gives table name…

Fix Gravity Forms & Magento 2 WordPress Integration confliction

Fatal error: Uncaught Error: Call to a member function get() on null in /magento/dir/vendor/magento/framework/Code/Generator.php:242 Stack trace: #0 /magento/dir/vendor/magento/framework/Code/Generator.php(120): Magento\Framework\Code\Generator->shouldSkipGeneration('logger', 'K', 'KLogger') #1 /wordpress/dir/wp-content/plugins/m2wp/include/classes/M2I_Mage_Autoloader.php(27): Magento\Framework\Code\Generator->generateClass('KLogger') #2…