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::setIsDeveloperMode(true); | |
ini_set('display_errors', 1); | |
umask(0); | |
Mage::app('admin'); | |
Mage::register('isSecureArea', 1); | |
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); |
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
SELECT cpe.entity_id, | |
cpe.sku | |
FROM catalog_product_entity AS cpe | |
LEFT JOIN catalog_category_product AS ccp | |
ON cpe.entity_id = ccp.product_id | |
LEFT JOIN catalog_product_entity_int AS cpi | |
ON cpe.entity_id = cpi.entity_id | |
WHERE category_id IS NULL | |
AND attribute_id = (SELECT attribute_id | |
FROM `eav_attribute` |
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); | |
ini_set('display_errors', '1'); | |
$proxy = new SoapClient('http://www.MYSITESURL.co.uk/index.php/api/soap/?wsdl'); | |
$sessionId = $proxy->login('SOAPUSER', 'SOAPPASS'); | |
$row = 1; | |
$errors = 0; | |
$handle = fopen('tier.csv', 'r'); |
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 | |
//get the remote host IP | |
$szRemoteIP = $_SERVER['REMOTE_ADDR']; | |
//this is the array holding the allowed IP's list; | |
$arrAllowedIPs = array("xxxxx","xxxxxx"); | |
if (!in_array($szRemoteIP, $arrAllowedIPs)) | |
{ | |
//if IP's is not in the list, deny access |
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'; | |
umask(0); | |
Mage::app('admin'); | |
error_reporting(1); | |
set_time_limit(0); | |
ini_set('memory_limit', '2048M'); | |
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::setIsDeveloperMode(true); | |
ini_set('display_errors', 1); | |
umask(0); | |
Mage::app('admin'); | |
Mage::register('isSecureArea', 1); | |
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); | |
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 //can be run as root script | |
require '../app/Mage.php'; | |
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); | |
$categoryId = 864; //Target Cat to copy | |
$baseCategoryId = 240; //Category to appear under | |
$category = Mage::getModel('catalog/category')->load($categoryId); |
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); | |
ini_set('display_errors', '1'); | |
require_once('../app/Mage.php'); | |
Mage::app(); | |
error_reporting(1); | |
set_time_limit(0); | |
ini_set('memory_limit', '2048M'); |
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 | |
//Possible color value | |
$attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'color'); //"color" is the attribute_code | |
$allOptions = $attribute->getSource()->getAllOptions(true, true); | |
foreach ($allOptions as $instance) { | |
$id = $instance['value']; //id of the option | |
$value = $instance['label']; //Label of the option | |
} | |
?> |
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
filepath: app/etc/modules/ | |
<?xml version="1.0"?> | |
<config> | |
<modules> | |
<My_Module> | |
<active>true</active> | |
<codePool>local</codePool> | |
</My_Module> | |
</modules> | |
</config> |