GithubHelp home page GithubHelp logo

markshust / magento2-module-ordergrid Goto Github PK

View Code? Open in Web Editor NEW
79.0 15.0 29.0 91 KB

The Order Grid module adds more details to the order grid in the admin.

License: MIT License

PHP 100.00%
magento magento2 magento2-module

magento2-module-ordergrid's Introduction

MarkShust_OrderGrid

Adds more details to the order grid in the admin.

Supported Magento Versions Latest Stable Version Composer Downloads Maintained - Yes

Table of contents

Summary

Out of the box, the Magento admin displays high-level information within the sales order grid. It does not provide more detailed information would could be useful to specific businesses.

This module adds more detailed information to the admin order grid. Initially, a new column is added to the order grid which contains order line items, which includes specific quantity and product names of items ordered.

Installation

composer require markshust/magento2-module-ordergrid
bin/magento module:enable MarkShust_OrderGrid
bin/magento setup:upgrade

Usage

This module has no configuration. Just install, and you'll see a new column in the order grid called Order Items.

Screenshot

License

MIT

magento2-module-ordergrid's People

Contributors

markshust avatar paugnu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

magento2-module-ordergrid's Issues

Magento Version issue

Hello,

Kindly test your module in Magento 2.3.5-p1
there are some issue in layout, kindly check

Thank You

Integrity constraint violation: 1052 Column 'created_at' in where clause is ambiguous,

successfully Installed this extension on magento version 2.2 and its working like expected. I also added a functionality to display SKU of product names and its working perfectly fine.

Issue - when i apply filters based on date selected, it shows "Something went wrong with processing the default view and we have restored the filter to its original state."

i checked magento exception.log and found this error.

[2020-01-20 08:11:55] main.CRITICAL: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'created_at' in where clause is ambiguous, query was: SELECT COUNT(DISTINCT main_table.entity_id) FROM sales_order_grid AS main_table
INNER JOIN sales_order_item ON main_table.entity_id = sales_order_item.order_id WHERE (created_at >= '2019-10-01 04:00:00') AND (created_at <= '2019-02-01 04:59:59') AND (status = 'processing') {"exception":"[object] (Zend_Db_Statement_Exception(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'created_at' in where clause is ambiguous, query was: SELECT COUNT(DISTINCT main_table.entity_id) FROM sales_order_grid AS main_table
INNER JOIN sales_order_item ON main_table.entity_id = sales_order_item.order_id WHERE (created_at >= '2019-10-01 04:00:00') AND (created_at <= '2019-02-01 04:59:59') AND (status = 'processing') at /home/jendei5/public_html/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:235, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'created_at' in where clause is ambiguous at /home/jendei5/public_html/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228)"} []

Customer orders grid not loading

Hi,

We face the problem, that the customer orders grid is not loading anymore.
The admin general order grid is working fine with the products, but inside a customer, the orders grid does not load.

We get the following error:

[2021-03-24 13:31:51] main.ERROR: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'customer_id' in where clause is ambiguous, query was: SELECT COUNT(DISTINCT main_table.entity_id) FROM sales_order_grid AS main_table
INNER JOIN sales_order_item ON main_table.entity_id = sales_order_item.order_id
LEFT JOIN sales_order_address AS customer_address ON main_table.entity_id = customer_address.parent_id and address_type="billing" WHERE (customer_id = '1') [] []

How can we solve this?

MySQL error, when Order Date filter is applied

When Order Date filter is applied the following error occurs:
SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'created_at' in where clause is ambiguous, query was: SELECT main_table.* FROM sales_order_gridASmain_tableINNER JOINsales_order_item ON main_table.entity_id = sales_order_item.order_id WHERE (((created_at >= '2023-02-01 05:00:00'))) AND (((created_at<= '2023-02-08 04:59:59'))) GROUP BYmain_table.entity_id ORDER BY main_table.created_at DESC LIMIT 20

As created_at exists in both sales_order and sales_order_grid, and created_at is not prefixed with main_table. the query is ambiguous.

Cannot install with PHP 7.2

Not possible to install with latest Magento 2.3 CE because it's running on PHP 7.2 and your composer.json file requires PHP 7.1 ... possible to fix?

The order grid page breaks and gives an error.

Preconditions

Magento Version : 2.4.6-p2
Module Version : 1.1.1

Description

When we order a product which has pipe symbol ( “ | ” ) in its SKU , then we try to visit the order grid page , it shows an error as shown in screenshot-1.

Screenshot-1

image

Steps To Reproduce

  1. Clone clean shop.
  2. Install “MarkShust_OrderGrid” module.
  3. Go to the Backend->Catalog->Products.
  4. Create any product with the pipe symbol ( “ | ” ) in its SKU ( e.g. SKU = Test | Product).
  5. Visit frontend , then order that product.
  6. Go to the Backend->Sales->Orders.

Expected Result

When we try to visit the order grid page , it should display product’s details in the Order Items column on the order grid page as shown in screenshot-2.

Screenshot-2

image

Actual Result

When we try to visit the order grid page , it shows an error as shown in screenshot-1.

Additional Information

The issue arises due to the use of the pipe symbol ( “ | ” ) as a delimiter in the explode function , which separates the SKU , Quantity , and Product Name , as shown in screenshot-3 . Consider using a different delimiter that is unlikely to appear in SKUs , such as a semicolon.

File Name

markshust/magento2-module-ordergrid/Model/ResourceModel/Order/Grid/Collection.php

Screenshot-3

image

Total records found does not work

We found another issue, the total records found does not work in the order grid. It keeps on "1 records found" and also the pagination does not work, it keeps 1 of 1, even if we have more than 10.000 results.

[Bug] Call to undefined method Magento\Framework\Api\Search\Document::getData() in /.../vendor/markshust/magento2-module-ordergrid/Plugin/FormatOrderItemsExport.php:25

I've got next exception while using the <exportButton/> component on the ui component grid (listing):

Error: Call to undefined method Magento\Framework\Api\Search\Document::getData() in /.../vendor/markshust/magento2-module-ordergrid/Plugin/FormatOrderItemsExport.php:25
Stack trace:
#0 /.../vendor/magento/framework/Interception/Interceptor.php(121): MarkShust\OrderGrid\Plugin\FormatOrderItemsExport->beforeGetRowData()
#1 /.../vendor/magento/framework/Interception/Interceptor.php(153): Magento\Ui\Model\Export\MetadataProvider\Interceptor->Magento\Framework\Interception\{closure}()
#2 /.../generated/code/Magento/Ui/Model/Export/MetadataProvider/Interceptor.php(41): Magento\Ui\Model\Export\MetadataProvider\Interceptor->___callPlugins()
#3 /.../vendor/magento/module-ui/Model/Export/ConvertToCsv.php(92): Magento\Ui\Model\Export\MetadataProvider\Interceptor->getRowData()
#4 /.../vendor/magento/module-ui/Controller/Adminhtml/Export/GridToCsv.php(70): Magento\Ui\Model\Export\ConvertToCsv->getCsvFile()
#5 /.../vendor/magento/framework/Interception/Interceptor.php(58): Magento\Ui\Controller\Adminhtml\Export\GridToCsv->execute()
#6 /.../vendor/magento/framework/Interception/Interceptor.php(138): Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor->___callParent()
#7 /.../vendor/magento/framework/Interception/Interceptor.php(153): Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor->Magento\Framework\Interception\{closure}()
#8 /.../generated/code/Magento/Ui/Controller/Adminhtml/Export/GridToCsv/Interceptor.php(23): Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor->___callPlugins()
#9 /.../vendor/magento/framework/App/Action/Action.php(111): Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor->execute()
#10 /.../vendor/magento/module-backend/App/AbstractAction.php(151): Magento\Framework\App\Action\Action->dispatch()
#11 /.../vendor/magento/framework/Interception/Interceptor.php(58): Magento\Backend\App\AbstractAction->dispatch()
#12 /.../vendor/magento/framework/Interception/Interceptor.php(138): Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor->___callParent()
#13 /.../vendor/magento/module-backend/App/Action/Plugin/Authentication.php(145): Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor->Magento\Framework\Interception\{closure}()
#14 /.../vendor/magento/framework/Interception/Interceptor.php(135): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch()
#15 /.../vendor/magento/framework/Interception/Interceptor.php(153): Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor->Magento\Framework\Interception\{closure}()
#16 /.../generated/code/Magento/Ui/Controller/Adminhtml/Export/GridToCsv/Interceptor.php(32): Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor->___callPlugins()
#17 /.../vendor/magento/framework/App/FrontController.php(245): Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor->dispatch()
#18 /.../vendor/magento/framework/App/FrontController.php(212): Magento\Framework\App\FrontController->getActionResponse()
#19 /.../vendor/magento/framework/App/FrontController.php(147): Magento\Framework\App\FrontController->processRequest()
#20 /.../vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch()
#21 /.../vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent()
#22 /.../vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}()
#23 /.../generated/code/Magento/Framework/App/FrontController/Interceptor.php(23): Magento\Framework\App\FrontController\Interceptor->___callPlugins()
#24 /.../vendor/magento/framework/App/Http.php(116): Magento\Framework\App\FrontController\Interceptor->dispatch()
#25 /.../generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http->launch()
#26 /.../vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http\Interceptor->launch()
#27 /.../pub/index.php(30): Magento\Framework\App\Bootstrap->run()
#28 {main}

Steps to reproduce:

  1. Go to the grid listing ui component with export button ui component
  2. instantiated object of \Magento\Framework\Api\Search\DocumentInterface type in the executed context is not instance of \Magento\Framework\DataObject
  3. Open export to dropdown
  4. Click Export button

Screenshots:

Screenshot 2023-05-22 at 20 26 43

Magento version: Adobe Commerce ver. 2.4.4-p2

I've added a temporarily fix for myself (git patch):

diff --git a/vendor/markshust/magento2-module-ordergrid/Plugin/FormatOrderItemsExport.php b/vendor/markshust/magento2-module-ordergrid/Plugin/FormatOrderItemsExport.php
index 4ae7a4f..401f24a 100644
--- a/vendor/markshust/magento2-module-ordergrid/Plugin/FormatOrderItemsExport.php
+++ b/vendor/markshust/magento2-module-ordergrid/Plugin/FormatOrderItemsExport.php
@@ -22,7 +22,7 @@ class FormatOrderItemsExport
         &$options
     ): array
     {
-        if ($orderItems = $document->getData('order_items')) {
+        if ($document instanceof \Magento\Framework\DataObject && $orderItems = $document->getData('order_items')) {
             $decodedItems = html_entity_decode($orderItems);
             $explodedItems = explode('</div><div>', $decodedItems);

--

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.