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 / shell
Created November 25, 2014 04:31
Magento CE 1.9.1.0 Installation Over ssh
wget http://www.magentocommerce.com/index.php/getmagento/1.9.1.0/magento-1.9.1.0.tar.gz
wget http://www.magentocommerce.com/downloads/assets/1.9.0.0/magento-sample-data-1.9.0.0.tar.gz
tar xvf magento-1.9.1.0.tar.gz
tar xvf magento-sample-data-1.9.0.0.tar.gz
mv magento-sample-data-1.9.0.0/media/* magento/media/
mv magento-sample-data-1.9.0.0/magento_sample_data_for_1.9.0.0.sql magento/data.sql
mv magento/* magento/.htaccess .
mysql -h DBHOST -u DBUSER -pDBPASS DBNAME < data.sql
rm -rf *.sample magento/ magento-sample-data-1.9.0.0/
rm -rf magento-1.9.1.0.tar.gz magento-sample-data-1.9.0.0.tar.gz data.sql\
@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 / export.sql
Created May 26, 2015 04:12
Export Magento Related, Crosssell, Upsell Products from Database
/* Related Products */
SELECT e.sku as sku, GROUP_CONCAT(ee.sku) as related_product FROM catalog_product_link l
INNER JOIN catalog_product_entity e on e.entity_id=l.product_id
INNER JOIN catalog_product_entity ee on ee.entity_id=l.linked_product_id
WHERE l.link_type_id=1
GROUP BY e.sku
/* Crosssell Products */
SELECT e.sku as sku, GROUP_CONCAT(ee.sku) as crossel_product FROM catalog_product_link l
INNER JOIN catalog_product_entity e on e.entity_id=l.product_id
@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 / 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 / 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