Okaeli_Grids
@category Okaeli
@package Okaeli_Grids
@author Julien Loizelet <julienloizelet@okaeli.com>
@copyright Copyright (c) 2018 Julien Loizelet
@license GNU GENERAL PUBLIC LICENSE Version 3
How many times have you been asked to add some field in a grid ?
If your answer is "too many times", then you may give a try to this extension., (*1)
Table of Contents
Created by gh-md-toc, (*2)
Description
Okaeli_Grids is a Magento 1 extension that allows to add column(s) in grid(s) after a specified column., (*3)
Available grids are product, order, invoice, customer, cms page, cms block and newsletter subscriber grids., (*4)
Available new fields are the attributes of the model concerned by the grid., (*5)
Usage
Use cases
- You just created a product attribute
my_awesome_attribute and want to display it in product grid.
- Someone asked you to add the
meta_description data in the Cms Pages grid.
Features
- Foreach available grid, you can choose a new field to add. You can also set after which column this new column will appear.
Finally, you can set the align style and width of the new column.
, (*6)
-
You can enable/disable each feature individually or enable/disable all at once., (*7)
-
There is a debug log feature that you can turn on/off as you wish., (*8)
, (*9)
Configurations
This extension comes with some configurations :, (*10)
System Configuration > Okaeli > Okaeli Grids, (*11)
-
General
- Enable / Disable all features
- Enable / Disable debug log
-
Product
- Enable / Disable Product Grid Feature
- Column(s) settings
-
Customer
- Enable / Disable Customer Grid Feature
- Column(s) settings
-
Order
- Enable / Disable Order Grid Feature
- Column(s) settings
-
Invoice
- Enable / Disable Invoice Grid Feature
- Column(s) settings
-
Cms Page
- Enable / Disable Cms Page Grid Feature
- Column(s) settings
-
Cms Block
- Enable / Disable Cms Block Grid Feature
- Column(s) settings
-
Subscriber
- Enable / Disable Subscriber Grid Feature
- Column(s) settings
Installation
This extension can be installed with modman, composer or manually., (*12)
Requirements
Tested on 1.9.3.6 only but it should work on earlier versions., (*13)
Modman
Composer
- Install composer.
-
Modify your composer.json file :, (*15)
"require": {
"okaeli/magento1-grids":"*"
}
"require": {
"okaeli/magento1-grids":"*"
},
"repositories": [
{
"type": "composer",
"url": "https://packages.firegento.com"
}
]
- Option 3): get the package from Github.
"require": {
"okaeli/magento1-grids":"dev-master"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/julienloizelet/magento1-grids"
}
]
- Then from your composer.json folder, run
php composer.phar install or composer install.
Manually
You can copy the files from the folders of this repository to the same folders of your installation., (*16)
Technical Notes
No rewrite. Events driven development.
This extension is 0 rewrite guaranteed. The following events are listened:, (*17)
-
core_block_abstract_to_html_before : used to add column to grid.
-
eav_collection_abstract_load_before : used to add attributes to eav model collection (product and customer).
-
sales_order_grid_collection_load_before : used to join order grid table with order table.
-
sales_order_invoice_grid_collection_load_before : used to join invoice grid table with invoice table.
Extension events
If you want to add more complex field (e.g join with other tables), you should extend this extension and/or use some custom dispatched events :, (*18)
-
okaeli_grids_column_add_before, okaeli_grids_column_add_after : use it to add your own column.
-
okaeli_grids_eav_collection_after : use it to join on eav collection.
Integration Tests
- Install first the
Codex_Xtest extension : find it here.
- Check that you retrieved the
tests folder of this extension.
- Set
active=true in the app/etc/modules/Codex_Xtest.xml file (Beware that this extension will rewrite the core/resource model).
- To run all the test of the
Okaeli_Grids extension, run the following command:
cd tests/
php phpunit.phar ../app/code/community/Okaeli/Grids/Test
- To run a specific test (for example tests for the product grid), run the following command:
cd tests/
php phpunit.phar ../app/code/community/Okaeli/Grids/Test/Integration/Admin/ProductGridTest.php
Coding Standards
This extension has been checked with the Magento Extension Quality Program Coding Standard.
You can find the output of the command phpcs /path/to/Okaeli/Grids/sources --standard=MEQP1 in this file., (*19)
Support
If you encounter any problems/bugs or if you have an idea of a new feature, please read the "How to submit an issue" file
and create an issue on GitHub., (*20)
Contribution
Any contribution is highly welcome. The best possibility to provide any code is to open
a pull request on GitHub., (*21)
Please read the "How to contribute" file., (*22)
License
GNU General Public License, version 3 (GPLv3), (*23)