Show configuration
If you have already a telnet connection established, you can readout the whole configuration of the box via: $> allcfgconv -C ar7 -c -o –
If you have already a telnet connection established, you can readout the whole configuration of the box via: $> allcfgconv -C ar7 -c -o –
To gain external access to MySQL database (f.e. in PHPSTorm or an external PHPMyAdmin) you can do: GRANT necessary privileges: CREATE USER ‘wdn_live_user’@’%’ IDENTIFIED BY ‘***’; GRANT USAGE ON *.* TO ‘wdn_live_user’@’%’ IDENTIFIED BY ‘***’ WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0; GRANT ALL PRIVILEGES ON `wdn_live`.* TO ‘wdn_live_user’@’%’; If the user already […]
There are different field types for Magento’s system configuration. These are for example: Button Checkboxes Checkbox Date File Hidden Imagefile Image Label Link Multiline Multiselect Note Obscure Password Radio Radios Reset Select Submit Textarea Text Time The following snippets show you how to add them to your system.xml: Enable selection (yes/no): <?xml version=”1.0″?> <config> <sections> […]
To rewrite exiting Magento models, you can add the following snippet to your modules config.xml: <?xml version=”1.0″?> <config> <modules> <AskSheldon_Module> <version>0.1.3</version> </AskSheldon_Module> </modules> <!– … –> <global> <models> <checkout> <rewrite> <session>AskSheldon_Module_Model_Checkout_Session</session> <type_onepage>AskSheldon_Module_Model_Checkout_Type_Onepage</type_onepage> </rewrite> </checkout> </models> </global> <!– … –> </config> In this case Mage_Checkout_Model_Session and Mage_Checkout_Model_Type_Onepage are rewritten.
MySQL don’t now an explode or split function. But you can use SUBSTRING_INDEX: SUBSTRING_INDEX(caet_ast.value, “\n”, 1) as street_name, SUBSTRING_INDEX(caet_ast.value, “\n”, -1) as street_nbr, This gets Testweg for street_name and 881 for street_nbr if caet_ast.value was “Testweg\n 881”. The function is also nestable: SUBSTRING_INDEX(SUBSTRING_INDEX(path, ‘/’, 2), ‘/’, -1) This makes 3 if path was 1/3/342/357/363.
To upload a file on the shell via FTP (https://en.wikipedia.org/wiki/File_Transfer_Protocol) you can use the wput command. Therefor you have to install it with your systems package manager (aptitude in this example): $> sudo apt-get install wput Now you can upload files like that: $> wput loacalfiletoupload ftp://user:password@host/path/to/target/on/remote/host Attention: The target path have to be relative to […]
To register a translation file for your module: <!– Translation file for FE –> <frontend> <translate> <modules> <Sheldon_Module> <files> <!– filename under app/locale/LANGUAGE_CODE/ f.e.: LANGUAGE_CODE = “EN_US” –> <default>filename.csv</default> </files> </Sheldon_Module> </modules> </translate> </frontend> Â <!– Translation file for BE–> <adminhtml> <translate> <modules> <Sheldon_Module> <files> <!– filename under app/locale/LANGUAGE_CODE/ f.e.: LANGUAGE_CODE = “EN_US” –> <default>filename.csv</default> […]
To find out where the MySQL configuration (my.cnf) is stored, you can use the strace command: $> strace mysql “;” 2>&1 | grep my.cnf You will get an output showing all the paths the MySQL deamon searches for the my.cnf upon startup like that: stat(“/etc/my.cnf”, 0x7fffecb75210) = -1 ENOENT (No such file or directory) stat(“/etc/mysql/my.cnf”, {st_mode=S_IFREG|0644, st_size=3505, […]
To include TypoScript from an external file you can add this line to the setup or constants part of a template record in Typo3 Backend: <INCLUDE_TYPOSCRIPT: source=”FILE: fileadmin/typoscript.ts”> To see your changes immediately, you should add the no_cache flag to your default config: config.no_cache = 1 This disables the caching of your TypoScript.
Sometimes, when you have to handle many data-sets, it is more efficient to save only those attributes that have changed: // load product $product = Mage::getModel(“catalog/product”)->load(142);  // change attribute $product->setTitle(“Test”);  // tell resource attribute to save only the specified field $product->getResource()->saveAttribute($product, “title”);