Thursday 26 April 2018

How to reindex | Upgrade | static-content:deploy | Cache flush | Cache clean | Important commands in Magento 2

You need to put this command on CMD | Terminal


For Upgrade data in Magento 2
php -dmemory_limit=5G bin/magento setup:upgrade 
For code compile
php bin/magento setup:di:compile
For Reindex data in Magento 2
php -dmemory_limit=5G bin/magento indexer:reindex
For Static Content Deploy data  in Magento 2
php -dmemory_limit=5G bin/magento setup:static-content:deploy -f
For Flush Cache in Magento 2
php -dmemory_limit=5G bin/magento cache:flush
For Clean Cache in Magento 2
php -dmemory_limit=5G bin/magento cache:clean
For generate a new image cache
bin/magento catalog:image:resize 
For 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 . 

Thursday 19 April 2018

Calendar.setup Calendar popup not display proper on Magento admin panel


HTML Code

<td class="label"><label for="tran_date">Date</label></td>
<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
 <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>

CSS

#calendar--flat {
    position: absolute;


Monday 16 April 2018

Remove / Disable checkbox Checked / unChecked when click on click row in magento 1.9

Need to change code in grid.js (magento\js\mage\adminhtml\grid.js)

Replace code from

rowMouseClick : function(event){
        if(this.rowClickCallback){
            try{
                this.rowClickCallback(this, event);
            }
            catch(e){}
        }
        varienGlobalEvents.fireEvent('gridRowClick', event);
    },
TO

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);
    },

Saturday 14 April 2018

SQLSTATE[HY000]: General error: 1 Can't create/write to file '/tmp/#sql_83d_0.MYI' (Errcode: 28) Magento / PHP

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 

Thursday 12 April 2018

How to Find / Search a file using CMD / Terminal Command Linux Ubuntu


1. Find file from computer using CMD / Terminal Command

sudo find / -name index.php
2. Find file from Specific Directory using CMD / Terminal Command

sudo find /var/www/html/ -name index.php