August 18, 2015 9:50 am
image_round

Magento create Directory automatically if not exists

Magento create Directory automatically if not exists with full directory hierarchy.

$baseDir = Mage::getConfig()->getBaseDir('media').DS.'registration'.DS.$this->getId();
Mage::getConfig()->createDirIfNotExists($baseDir);

Magento create Directory automatically if not exists

Magento create Directory automatically if not exists with full directory hierarchy.

$baseDir = Mage::getConfig()->getBaseDir('media').DS.'registration'.DS.$this->getId();
Mage::getConfig()->createDirIfNotExists($baseDir);
August 16, 2015 8:43 am
image_round

Magento – Mass Exclude / Unexclude Images

By default, Magento will check the ‘Exclude’ box for you on all imported images, making them not show up as a thumbnail under the main product image on the product view. Should you ever want to mass unexclude them (or mass exclude your images), you can simply run one of the following sql commands in your database

# Mass Unexclude
UPDATE`catalog_product_entity_media_gallery_value` SET `disabled` = '0' WHERE `disabled` = '1';
 
# Mass Exclude
UPDATE`catalog_product_entity_media_gallery_value` SET `disabled` = '1' WHERE `disabled` = '0';

Magento – Mass Exclude / Unexclude Images

By default, Magento will check the ‘Exclude’ box for you on all imported images, making them not show up as a thumbnail under the main product image on the product view. Should you ever want to mass unexclude them (or mass exclude your images), you can simply run one of the following sql commands in your database

# Mass Unexclude
UPDATE`catalog_product_entity_media_gallery_value` SET `disabled` = '0' WHERE `disabled` = '1';
 
# Mass Exclude
UPDATE`catalog_product_entity_media_gallery_value` SET `disabled` = '1' WHERE `disabled` = '0';
August 10, 2015 7:01 am
image_round

Import Export database through ssh

1. Exporting a MySQL database
To export a MySQL database, you need to use the mysqldump command. Here is the full command for exporting your database:

mysqldump -uUSERNAME -pPASSWORD DATABASE > backup.sql

Make sure you replace USERNAME, PASSWORD and DATABASE with the appropriate values for your database. The MySQL database will be exported to a file named “backup.sql” in your current directory. The name of the MySQL dump you are exporting to can be whatever you want.

2. Importing a MySQL database
To import a MySQl database, you need to use the mysql command. Here is the full command for importing a MySQL dump into a database:

mysql -uUSERNAME -pPASSWORD DATABASE < backup.sql

Import Export database through ssh

1. Exporting a MySQL database
To export a MySQL database, you need to use the mysqldump command. Here is the full command for exporting your database:

mysqldump -uUSERNAME -pPASSWORD DATABASE > backup.sql

Make sure you replace USERNAME, PASSWORD and DATABASE with the appropriate values for your database. The MySQL database will be exported to a file named “backup.sql” in your current directory. The name of the MySQL dump you are exporting to can be whatever you want.

2. Importing a MySQL database
To import a MySQl database, you need to use the mysql command. Here is the full command for importing a MySQL dump into a database:

mysql -uUSERNAME -pPASSWORD DATABASE < backup.sql