Skip to content

Instantly share code, notes, and snippets.

View sashas777's full-sized avatar
🌟
Per Aspera Ad Astra!

Alexander Lukyanov sashas777

🌟
Per Aspera Ad Astra!
View GitHub Profile
@sashas777
sashas777 / gist:6996c69e186bc85a5e6d
Last active August 29, 2015 14:15
Magento Admin 404 not found page
SET FOREIGN_KEY_CHECKS=0;
UPDATE `core_store` SET store_id = 0 WHERE code='admin';
UPDATE `core_store_group` SET group_id = 0 WHERE name='Default';
UPDATE `core_website` SET website_id = 0 WHERE code='admin';
UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code='NOT LOGGED IN';
SET FOREIGN_KEY_CHECKS=1;
@sashas777
sashas777 / view.phtml
Last active August 29, 2015 14:17
Code for integration ConfImages with CloudZoom 1.0.2
<?php
/**
* @author Sashas
* @category Sashas
* @package Sashas_Confimages
* @copyright Copyright (c) 2015 Sashas IT Support Inc. (http://www.sashas.org)
* @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, version 3 (GPL-3.0)
*/
$_product=$this->getProduct();
@sashas777
sashas777 / module.xml
Created July 24, 2015 20:46
Magento 2 Customer Attribute Extension - module.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* @author Sashas
* @category Sashas
* @package Sashas_CustomerAttribute
* @copyright Copyright (c) 2015 Sashas IT Support Inc. (http://www.extensions.sashas.org)
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
@sashas777
sashas777 / magento_observer_dispatch
Last active December 15, 2015 20:55
Magento Dispatch Observer
<?php
class Mage_Customer_AccountController extends Mage_Core_Controller_Front_Action
{
....
/**
* Dispatch Event
*
* @param Mage_Customer_Model_Customer $customer
@sashas777
sashas777 / config.xml
Last active December 15, 2015 21:23
Example of Observer usage in config.xml file
<?xml version="1.0"?>
<config>
<global>
<events>
<customer_register_success>
<observers>
<example_customer_register_success>
<type>singleton</type>
<class>module/observer</class>
<method>customerRegisterSuccess</method>
@sashas777
sashas777 / Observer.php
Created December 15, 2015 21:31
Example of Observer.php file
<?php
class Namespace_Module_Model_Observer {
public function customerRegisterSuccess(Varien_Event_Observer $observer) {
$customer=$observer->getCustomer();
}
}
Verifying that +sashas is my blockchain ID. https://onename.com/sashas
@sashas777
sashas777 / InstallData.php
Created July 24, 2015 20:49
Magento 2 Customer Attribute Extension - InstallData.php
<?php
/**
* @author Sashas
* @category Sashas
* @package Sashas_CustomerAttribute
* @copyright Copyright (c) 2015 Sashas IT Support Inc. (http://www.extensions.sashas.org)
*/
namespace Sashas\CustomerAttribute\Setup;
@sashas777
sashas777 / module.xml
Created January 24, 2017 04:56
Magento 2.1.3 Make Customer Attribute - module.xml
<?xml version="1.0"?>
<!--
~ @author Sashas IT Support <support@sashas.org>
~ @copyright 2017 Sashas IT Support Inc. (http://www.extensions.sashas.org)
~ @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, version 3 (GPL-3.0)
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Sashas_CustomerAttribute" setup_version="2.0.0">
<sequence>
<module name="Customer"/>
@sashas777
sashas777 / registration.php
Created January 24, 2017 04:57
Magento 2.1.3 Make Customer Attribute - registration.php
<?php
/**
* @author Sashas IT Support <support@sashas.org>
* @copyright 2017 Sashas IT Support Inc. (http://www.extensions.sashas.org)
* @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, version 3 (GPL-3.0)
*/
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Sashas_CustomerAttribute',