Hot answers tagged

19 votes
Accepted

Magento : How to Check if Mysql Column Exists?

You can use this to check if table column exists. $installer = $this; $installer->startSetup(); $connection = $installer->getConnection(); $tableName = $installer->getTable('...
Priyank's user avatar
  • 7,672
13 votes
Accepted

Magento 2: Add custom column to filter option in order grid?

For the performance, the Order Admin Grid will load the values from sales_order_grid. So, we need to add more columns to this table. app/code/Vendor/SalesOrder/Setup/UpgradeSchema.php <?php ...
Khoa TruongDinh's user avatar
11 votes
Accepted

Magento 2 Filter not working while Custom column added on Sales Grid Using Ui Component

I have the same issue and $this->addFilterToMap() fix my issue.. check this answer Magento 2 grid uiComponent: include a table alias in a column filter
Emipro Technologies Pvt. Ltd.'s user avatar
8 votes
Accepted

How to add Email address in sales orders admin grid?

First of all, you need to get the customer email by performing a join with sales_flat_order table. Your _prepareCollection() function will be: protected function _prepareCollection() { $...
Alex Constantinescu's user avatar
7 votes

Magento 2 - How to add a custom column in customer grid

Solution for Magento 2.1 Add the attribute to the customer grid index: etc/indexer.xml <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:...
Fabian Schmengler's user avatar
7 votes
Accepted

Magento 1: admin product grid column value disappear on name search

After digging very deep into Magento code and getting my hands dirty as I expected, I've found the root cause of the problem. When the collection is loaded (implicitely via getFirstItem in @Simon ...
Raphael at Digital Pianism's user avatar
7 votes
Accepted

Magento 1.9 - How to add serial number in sales orders list & invoice list?

Please follow below step to add SR No into Sales order items list. Open app/design/adminhtml/default/default/template/sales/order/view/items.phtml file and replace with below code. <?php $...
Bhavin Pethani's user avatar
6 votes
Accepted

Make column unique in install schema script

You can use addIndex method having type \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE, like: $table = $installer->getConnection()->newTable( $installer->getTable(...
Siarhey Uchukhlebau's user avatar
6 votes
Accepted

Magento 2 bar disappeared in Sales Order Grid after adding column

The bar was under the table and not disappeared. Just adjust the order and you'll get this solved. I solved the problem in Magento 2.2.x adding <listingToolbar name="listing_top"/> on top of ...
Vixent's user avatar
  • 349
6 votes
Accepted

Remove column from Order grid based on condition

It Might be helpful to you. <listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd"> <...
Dharmendra Jadav's user avatar
5 votes
Accepted

Magento 2 add row total column in grid

I find a solution. I hope this can help you. Find the row in your ui component js file where is write the item tag with name "component": <argument name="data" xsi:type="array"> <...
ProcessKiller's user avatar
5 votes

Magento 2 - How to add a custom column in customer grid

Finally got the solution : We need to create indexer.xml file in /etc/di folder. Main thing is view_id in view_id we need to pass "coloumn_name" which we need to show in grid. For example here i ...
Manthan Dave's user avatar
  • 9,806
5 votes
Accepted

Magento2 how to set default columns in admin grid

magento provide facility to add product attribute directly in grid without any customization. Please check carefully the selected checkbox are all table columns while unchecked are product attributes....
poojan sharma's user avatar
4 votes

Magento 2 : Change Admin grid column width

At the moment on Magento 2.3.2 the only working solution requires adding configuration in 2 peaces in List (Grid) UI component: Setup resizeConfig for columns config. Setup resizeDefaultWidth for ...
Oleksii Lisovyi's user avatar
4 votes

Disable filter for column in Magento 2 grid component

It is simple, just comment or remove "filter" node in column definition: <column name="prxgt_is_in_odoo"> <argument name="data" xsi:type="array"> <item name="...
Alex Gusev's user avatar
  • 1,999
4 votes

Magento 2 adminhtml custom column sorting ascending and descending

<column name="order_state" class="Foobar\InvoiceOrderStatus\Ui\Component\Listing\Column\Status"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"&...
Prince Patel's user avatar
  • 22.7k
4 votes

How to remove/hide columns from sales grid by default

You need to override sales_order_grid.xml as you said. Put this code into your module, file view/adminhtml/ui_component/sales_order_grid.xml <?xml version="1.0" encoding="UTF-8"?> <!-- /*...
Sasa Jovanovic's user avatar
3 votes

Magento 1: admin product grid column value disappear on name search

I digged into that a bit and found out that this is a really weird Magento behaviour. I did not find a solution yet, but wanted to share my findings anyway. The issue is actually that if you have a ...
Simon's user avatar
  • 5,725
3 votes
Accepted

Is the column `Action` very important?

Generally, the Action column is not important as long as it is doing the same as clicking on the row. Action tab is added when there are more operations to perform on a row, like in the CMS Pages grid ...
Piyush's user avatar
  • 5,893
3 votes

Is the column `Action` very important?

$this->addColumn('action', array(...)) adds the action column in the grid. Yes if you wish to remove you can. You can remove from css, commenting or by removing the whole code.It will not break ...
Priyank's user avatar
  • 7,672
3 votes
Accepted

Magento 2 Grid custom column value in Ui Listing

Remove argument component from app/code/Vendor/Theme/view/adminhtml/ui_component/your_ui_grid.xml <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/select</item> If ...
Prince Patel's user avatar
  • 22.7k
3 votes
Accepted

Magento2 remove columns from admin sales order view page items grid

You can Try this its work for me. Add sales_order_view.xml file in your custom module Packagename/Modulename/view/adminhtml/layout and remove column as per your requirement. <block class="Magento\...
poojan sharma's user avatar
3 votes
Accepted

How to update custom column value in quote_item table magento 2

I suggest you use implement extension attribute for this field at here. See how to use Extension attribute. https://devdocs.magento.com/guides/v2.3/extension-dev-guide/extension_attributes/adding-...
Amit Bera's user avatar
  • 77.4k
2 votes

Magento2: 3columns Layout only renders 2columns-right

You aren't doing anything wrong. There is not a 3 column layout in the Magento 2 core. Fortunately, it is pretty simple to create your own layout. You can use 2columns-left.xml as an example. You can ...
Nathan Toombs's user avatar
2 votes

CMS Home Page layout issue

Make sure that the layout of your cms page is 2 columns left and not 1 column (check in the admin). If it still not shows up properly, then it is a coding issue, so look in page/template/2columns-...
Claudiu Creanga's user avatar
2 votes
Accepted

I want to put category name in product page left column top, what to do?

To me it sounds like your $_product variable is not properly defined. I reckon you should try adding the following code before the code you pasted: $_product = Mage::registry('current_product'); ...
Raphael at Digital Pianism's user avatar
2 votes

how to put filtration in first order in left column magento

Usage of options before and after for blocks in the layout may help, when all your blocks are called with one method getChildHtml() without mentioning block name. Or the block that contains your ...
Mageworx's user avatar
  • 3,786
2 votes
Accepted

how to put filtration in first order in left column magento

You'd study your layout frontend files Check for <reference name="left"> tag, and play with before and after parameters to get your desired order
Raul Sanchez's user avatar
  • 3,276
2 votes
Accepted

Are truncate, nl2br, and escape real UI Component Column Configurations

Looking closely at 2.1, I don't think these arguments are used for now, hopefully they will in future releases. The only way to acheive the truncate effect in a Ui listing I found so far is to act ...
F. Perrin's user avatar
  • 176
2 votes

How to add new column to existing module table?

Please use : $installer = $this; $installer->startSetup(); $installer->getConnection() ->addColumn($installer->getTable('sales/order'),'custom_value', array( 'type' => ...
Sneha Panchal's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible