Skip to content

Instantly share code, notes, and snippets.

@doug48
doug48 / getConfigNodes.php
Last active August 16, 2018 08:23
magento 1 get config.xml node values
<?php
//Note name children with unique names
//<store_attachments>
// <store_1></store_1>
//
//</store_attachments>
$value = Mage::getConfig()->getNode('store_attachemnts')->asArray();
// or
$value = Mage::getConfig()->getNode('default/store_attachemnts')->asArray();
@doug48
doug48 / flush.sh
Created August 26, 2016 14:55
Magento 2 flush cache files
#!/usr/bin/env bash
rm -rf /var/www/vhosts/partyshowroom/production/htdocs/var/cache/*
rm -rf /var/www/vhosts/partyshowroom/production/htdocs/var/page_cache/*
@doug48
doug48 / fvarn.sh
Created August 26, 2016 14:54
Magento 2 restart varnish cache
#!/usr/bin/env bash
sudo /etc/init.d/varnish restart
@doug48
doug48 / bin_magento.txt
Created July 4, 2016 07:54
Magento 2 bin/magento commands
Available commands:
help Displays help for a command
list Lists commands
admin
admin:user:create Creates an administrator
admin:user:unlock Unlock Admin Account
cache
cache:clean Cleans cache type(s)
cache:disable Disables cache type(s)
cache:enable Enables cache type(s)
@doug48
doug48 / hintsoff.sh
Created April 29, 2016 10:37
Shell script to turn off magento 2 template and block hints, add the file to ~/bin in your vagrant and set permissions to 755
#!/bin/bash
mysql -u root -proot << EOF
use party_local;
UPDATE party_local.core_config_data SET value='0' WHERE path='dev/debug/template_hints_blocks';
UPDATE party_local.core_config_data SET value='0' WHERE path='dev/debug/template_hints_storefront';
EOF
@doug48
doug48 / hintson.sh
Last active April 29, 2016 10:36
Shell script to turn on magento 2 template and block hints, add the file to ~/bin in your vagrant and set permissions to 755
#!/bin/bash
mysql -u root -proot << EOF
use party_local;
UPDATE party_local.core_config_data SET value='1' WHERE path='dev/debug/template_hints_blocks';
UPDATE party_local.core_config_data SET value='1' WHERE path='dev/debug/template_hints_storefront';
EOF
@doug48
doug48 / firephp.php
Last active August 29, 2015 14:13
fire php use in helper file
<?php
public function sendToFirebug($content) {
$writer = new Zend_Log_Writer_Firebug();
$logger = new Zend_Log($writer);
$request = new Zend_Controller_Request_Http();
$response = new Zend_Controller_Response_Http();
$channel = Zend_Wildfire_Channel_HttpHeaders::getInstance();
$channel->setRequest($request);