Archive for November 2018

Update website base url

UPDATE core_config_data SET VALUE=’http://www.website.com/’ WHERE path=’web/unsecure/base_url’; UPDATE core_config_data SET VALUE=’http://www.website.com/’ WHERE path=’web/secure/base_url’;

Cms Block Stores

$blockCollection = Mage::getResourceModel(’cms/block_collection’); foreach($blockCollection as $block) { Zend_Debug::dump($block->getResource()->lookupStoreIds($block->getBlockId())); }

Redirecting in observer

$controller = $observer->getEvent()->getControllerAction(); $controller->getResponse()->setRedirect($redirectUrl); $controller->setFlag(”, Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true); $controller->setFlag(”, Mage_Core_Controller_Varien_Action::FLAG_NO_POST_DISPATCH, true);

Reset customer password in db

UPDATE customer_entity_varchar SET VALUE = md5(’new_password’) WHERE entity_id=(SELECT entity_id FROM customer_entity WHERE email=’email@hostname.com’) AND attribute_id IN (SELECT attribute_id FROM eav_attribute WHERE attribute_code = ‘password_hash’ AND entity_type_id = 1);