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('...
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
...
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
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()
{
$...
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:...
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 ...
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 $...
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(...
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 ...
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">
<...
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">
<...
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 ...
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....
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="...
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"&...
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"?>
<!--
/*...
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 ...
3
votes
Accepted
Set 2columns-left on any page of the website
Lets debug, in view.phtml please add below code for getting template
$this->getLayout()->getBlock('root')->getTemplateFile();
If it given value ...page/2columns-left.phtml then the ...
3
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 ...
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 ...
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 ...
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 ...
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\...
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-...
2
votes
add column to sales/orders grid
Just check out Enhanced Admin Grids. A so powerful and free extension from jayelkaake
2
votes
Trying to filter by 'In Stock' or 'Out of Stock' on product admin grid
Since it's a custom module, we need to write a method to filter the stock status in the observer as follows:
public function filterStockStatus($collection, $column)
{
$filterValue = $column->...
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');
...
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 ...
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
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-...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
column × 130magento2 × 50
grid × 38
magento-1.9 × 26
admin × 14
database × 13
layout × 11
order-grid × 11
product × 8
custom-column-grid × 8
orders × 7
custom × 7
magento-1 × 6
adminhtml × 6
sales-order × 6
filter × 6
category × 5
uicomponent × 5
sidebar × 5
magento-1.7 × 4
collection × 4
sorting × 4
home × 4
magento-2.1 × 3
module × 3