This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
error_reporting(E_ALL | E_STRICT); | |
$mageFilename = 'app/Mage.php'; | |
require_once $mageFilename; | |
Mage::setIsDeveloperMode(true); | |
umask(0); | |
Mage::app(); | |
Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID)); | |
$setup = new Mage_Eav_Model_Entity_Setup('core_setup'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# Create New admin User programmatically. | |
require_once('./app/Mage.php'); | |
umask(0); | |
Mage::app(); | |
try { | |
$user = Mage::getModel('admin/user') | |
->setData(array( | |
'username' => 'developer', | |
'firstname' => 'developer', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
php bin/magento setup:upgrade | |
rm -rf pub/static/frontend/* | |
rm -rf pub/static/adminhtml/* | |
rm -rf var/view_preprocessed/* | |
php -f bin/magento setup:static-content:deploy | |
sudo chmod -Rf 777 pub/ | |
sudo chmod -Rf 777 var/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
php bin/magento setup:install --base-url=http://127.0.0.1/magento211-sample/ --db-host=localhost --db-name=magento211-sample --db-user=root --db-password= --admin-firstname=Magento --admin-lastname=User --admin-email=jaanhaitojahanhai@gmail.com --admin-user=admin --admin-password=admin123 --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include 'app/Mage.php'; | |
Mage::app(); | |
$customerid = ''; | |
$product_id = ''; | |
$file = fopen("review.csv","r"); | |
$header = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(php_sapi_name()!=="cli"){ | |
echo "Must be run from the commend line."; | |
}; | |
/** | |
* Setup a magento instance so we can run this export from the command line. | |
*/ | |
require_once('app/Mage.php'); | |
umask(0); | |
if (!Mage::isInstalled()) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$mageFilename = 'app/Mage.php'; | |
require_once $mageFilename; | |
Mage::app(); | |
$sql= ' | |
SET FOREIGN_KEY_CHECKS=0; | |
TRUNCATE `sales_flat_creditmemo`; | |
TRUNCATE `sales_flat_creditmemo_comment`; | |
TRUNCATE `sales_flat_creditmemo_grid`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1: Prepare CSV file(update_missing_images.csv) with only one field: sku and upload to the root of Magento installation. | |
Note: This will contain the sku of those products whose images are missing at the backend. | |
2: Create a file: update_missing_images.php and upload to the root of magento installation and paste the following code: update_missing_images.php | |
3: Open your browser and run the following URL: http://your-magento-url/update_missing_images.php | |
4: That’s all. Try to browse the Images tab, now you will see those missing images. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'app/Mage.php'; | |
Mage::app(); | |
$xml = simplexml_load_file('./app/etc/local.xml', NULL, LIBXML_NOCDATA); | |
if(is_object($xml)) { | |
$db['host'] = $xml->global->resources->default_setup->connection->host; | |
$db['name'] = $xml->global->resources->default_setup->connection->dbname; | |
$db['user'] = $xml->global->resources->default_setup->connection->username; |