Skip to content
G31 Zone
  • About
  • Contact

JQuery – Ajax request with jQuery

Posted on: November 21, 2010 /
Categories: JQuery

Perform an Ajax request with jQuery: jQuery.ajax({ url: ‘url_of_ajax_request’, success: function(response) { alert(‘Response from url is: ‘ + response) } }); Source: JQuery Ajax

Magento get front controller name

Posted on: November 17, 2010 /
Categories: Magento

Magento get front controller name: Mage::app()->getFrontController()->getRequest()->getRouteName()

Magento get parameters

Posted on: November 17, 2010 /
Categories: Magento

Get a parameter value: $paramValue = $this->getRequest()->getParam($paramName); Get all parameters and values: $allParams = $this->getRequest()->getParams();

Magento get subcategories

Posted on: November 16, 2010 /
Categories: Magento

Get subcategories of a main category: $_cat = Mage::getModel(‘catalog/category’)->load($cat_id); $_subcats = $_cat->getChildrenCategories(); foreach ($_subcats as $subcat) { echo “<h1>” . $subcat->getName() . “<h1>”; } Get subcategories Ids $subcat_ids = Mage::getResourceSingleton(‘catalog/category_tree’)->load()->getChildren($cat_id, false);

Magento Installation – 404 not found

Posted on: November 16, 2010 /
Categories: Magento

Hack to solve the “404 Not Found error” after magento installation: Replace in the original index.php: Mage::run(”); with Mage::run(‘default’); Instead of ‘default’ can be used the name of default store.

Magento – TinyMCE Image Uploader / Image incorrect URL

Posted on: November 15, 2010 /
Categories: Magento

Small hack in file: app/code/core/Mage/Cms/Helper/Wysiwyg/Images.php to correct image url from something like: <img src=”http://www.mysite.com//index.php/admin/cms_wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ii9jbGFzc2lmaWVkVUwuanBnIn19/key/f90eef374eaee0f5b76fc9783680c059/” /> into the correct image url. public function getImageHtmlDeclaration($filename, $asIs = false) { $fileurl = $this->getCurrentUrl() . $filename; $mediaPath = str_replace(Mage::getBaseUrl(‘media’), ”, $fileurl); $directive = sprintf(‘{{media url=”%s”}}’, $mediaPath); $directive = $fileurl; if ($asIs) { $html = sprintf(”, $directive); } else {

Read More →

Magento – add contact form into a cms page

Posted on: November 14, 2010 /
Categories: Magento

Add contact form to CMS Pages: {{block type=”core/template” name=”contactForm” form_action=”/contacts/index/post” template=”contacts/form.phtml”}}

Php – read all files and folders from a directory

Posted on: October 25, 2010 /
Categories: PHP

Read all files and folders from a directory using scandir: $dir = “/temp”; $files = scandir($dir); print_r($files); Read all files and folders from a directory using opendir: $dir = “/temp/” if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { echo “Filename: ” . $file . “: filetype: ” .

Read More →

MySQL – create user and grant all privileges

Posted on: October 24, 2010 /
Categories: MySQL

Create user with mysql command: CREATE USER ‘username’@’localhost’ IDENTIFIED BY ‘password’; Add all privilleges to databases for user: GRANT ALL ON *.* TO ‘username’@’localhost’;

MySQL – import / export database from / into file

Posted on: October 23, 2010 /
Categories: MySQL

Export database into a file with shell command: mysqldump -u USERNAME -p PASSWORD database > filename.ext; Import database from a file with shell command: mysql -u USERNAME -p PASSWORD database < filename.ext;

« 1 … 5 6 7 8 9 »

Categories

  • Apache
  • CentOS
  • Git
  • HTML
  • HTTP
  • JavaScript
  • JQuery
  • Linux
  • Magento
  • MySQL
  • PHP
  • Regular expression (Regex)
  • Smarty
  • Symfony 2 / Doctrine
  • Twig
  • Ubuntu
  • Uncategorized
  • Zend

Archives

  • June 2015
  • May 2015
  • March 2015
  • September 2014
  • October 2013
  • September 2013
  • August 2013
  • July 2013
  • January 2013
  • October 2012
  • August 2012
  • May 2012
  • April 2012
  • January 2012
  • December 2011
  • November 2011
  • July 2011
  • June 2011
  • May 2011
  • April 2011
  • February 2011
  • January 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010

Recent Posts

  • Connect to VPN from Linux
  • Enable slow query log on MySQL server
  • Doctrine Console Commands
  • Symfony2 Doctrine debug query
  • Mysqldump only tables with certain prefix

Tags

ajax all post data apache asynchronously bookmark categories images category category thumbnail create subdomain create virtualhost git git basics git force overwrite git pull htaccess html html codes HTTP status codes JavaScript javascript getcookie javascript get url javascript setcookie javascript strip tags javascript strip_tags jquery jquery.validator jquery ajax jquery bookmark jquery validator rule Lorem ipsum Magento mysql php preview button preview target blank print array products redirect www soap soap client soap sample soap server status codes zend framework 1 zend trace mysql errors

Copyright G31 Zone 2026 | Theme by Theme in Progress | Proudly powered by WordPress