Open Following file
Open MagentoRoot/lib/Varien/Db/Adapter/Pdo/Mysql.phpUpdate false to true
protected $_debug = true
protected $_logAllQueries = true
Shopify, Shopify Apps, Magento, WordPress, Codeigniter, Joomla, Big Commerce | PHP
Open MagentoRoot/lib/Varien/Db/Adapter/Pdo/Mysql.phpUpdate false to true
protected $_debug = true
protected $_logAllQueries = true
php -dmemory_limit=5G bin/magento setup:upgradeFor code compile
php bin/magento setup:di:compileFor Reindex data in Magento 2
php -dmemory_limit=5G bin/magento indexer:reindexFor Static Content Deploy data in Magento 2
php -dmemory_limit=5G bin/magento setup:static-content:deploy -fFor Flush Cache in Magento 2
php -dmemory_limit=5G bin/magento cache:flushFor Clean Cache in Magento 2
php -dmemory_limit=5G bin/magento cache:cleanFor generate a new image cache
bin/magento catalog:image:resizeFor Files and Directory Permission
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
find var pub/static pub/media generated/ app/etc -type f -exec chmod g+w {} \;
find var pub/static pub/media generated/ app/etc -type d -exec chmod g+ws {} \;
chown -R ubuntu:www-data .
chmod u+x bin/magento
chmod -R 777 .
<td class="label"><label for="tran_date">Date</label></td>SCRIPT
<td class="value">
<input name="deposit[created_at]" id="tran_date" type="text" class="input-text" value="<?php echo Mage::getModel('core/date')->gmtDate('m/d/Y'); ?>"/>
<img src="<?php echo $this->getSkinUrl('images/grid-cal.gif') ?>" class=""
id="tran_date_trig"/>
<div id="calendar--flat"></div>
</td>
</tr>
<script type="text/javascript">
// <![CDATA[
Calendar.setup({
flat: 'calendar--flat',
ifFormat: '%m/%e/%Y',
button: 'tran_date_trig',
align: 'Bl',
singleClick: true,
onSelect: function(dateText,selectedDate) {
jQuery('#tran_date').val(selectedDate);
jQuery('#calendar--flat').hide();
}
});
// ]]>
</script>
#calendar--flat {
position: absolute;
}
rowMouseClick : function(event){TO
if(this.rowClickCallback){
try{
this.rowClickCallback(this, event);
}
catch(e){}
}
varienGlobalEvents.fireEvent('gridRowClick', event);
},
rowMouseClick : function(event){
var element = Event.findElement(event, 'table');
if(element.id!='depositGrid_table') {
if(this.rowClickCallback){
try{
this.rowClickCallback(this, event);
}
catch(e){}
}
}
varienGlobalEvents.fireEvent('gridRowClick', event);
},
Problem can be connected with inodes. Maybe you have too many small files and your inodes are full. You can check inode status with df -i
sudo find / -name index.php2. Find file from Specific Directory using CMD / Terminal Command
sudo find /var/www/html/ -name index.php
Step 1.
Copy file from "app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php" to "app/code/local/Mage/Adminhtml/Block/Catalog/Product/Grid.php"
Step 2 : Add Column for category.
protected function _prepareColumns() {
......
......
......
$this->addColumn(
'category_id',
array(
'header' => Mage::helper('jaydip_kansagra')->__('Category'),
'width' => '100px',
'index' => 'category_ids',
'type' => 'options',
'options' => $this->getCategoriesOptions(),
'filter_condition_callback' => array($this, '_callbackCategoryFilter'),
'renderer' => 'Jaydip_Kansagra_Block_Adminhtml_Renderer_Categories'
)
);
......
......
......
}
Step 3 : Create new functions in this grid file.
protected function getCategoriesOptions() {
$categoriesOptions = array();
$this->prepareCategoriesOptions($this->_getCategories()->getNodes(), $categoriesOptions);
return $categoriesOptions;
}
protected function _getCategories() {
$storeId = (int) $this->getRequest()->getParam('store');
if ($storeId) {
$store = Mage::app()->getStore($storeId);
$parent = $store->getRootCategoryId();
} else {
$parent = Mage_Catalog_Model_Category::TREE_ROOT_ID;
}
$tree = Mage::getResourceModel('catalog/category_tree');
/* @var $tree Mage_Catalog_Model_Resource_Category_Tree */
$nodes = $tree->loadNode($parent)
->loadChildren(0)
->getChildren();
$tree->addCollectionData(null, true, $parent, true, false);
return $nodes;
}
protected function prepareCategoriesOptions($nodes, &$options) {
/** @var $node Varien_Data_Tree_Node */
foreach ($nodes as $node) {
if ($node->getName()) {
$options[$node->getId()] = str_repeat(' ', $node->getLevel() - 1) . $node->getName();
}
if ($node->hasChildren()) {
$this->prepareCategoriesOptions($node->getAllChildNodes(), $options);
}
}
return $options;
}
*********Or For without category tree view**********
protected function getCategoriesOptions() {
$categoriesOptions = array();
$this->prepareCategoriesOptions($this->_getCategories()->getNodes(), $categoriesOptions);
return $categoriesOptions;
}
Step 4 : Create new function for filter in this file protected method _callbackCategoryFilter
protected function _callbackCategoryFilter($collection, $column)
{
if (!$value = $column->getFilter()->getValue()) {
return null;
}
$collection->joinField(
'category_id',
'catalog/category_product',
'category_id',
'product_id = entity_id',
'{{table}}.category_id=' . $column->getFilter()->getValue(),
'inner'
);
}
Step 5 : Create renderer file in any extension
class Jaydip_Kansagra_Block_Adminhtml_Renderer_Categories extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract {
public function render(Varien_Object $row) {
$productCategories = array();
$product = Mage::getModel('catalog/product')->load($row->getData('entity_id'));
$categories = $product->getCategoryCollection()->addAttributeToSelect('name');
foreach ($categories as $category) {
array_push($productCategories, $category->getName());
}
return implode(',', $productCategories);
}
}