Pages

Friday, January 25, 2013

Reinstall custom module in magento


  1. Delete the appropriate table name in core_resource db table
  2. Delete the module table

Wednesday, January 23, 2013

Add a glow around textarea on focus in html forms

In the css file, add the following lines:

textarea{border: 1px solid #ccc;}
textarea:focus{box-shadow: 0 0 8px rgba(82,168,236,.5); border: 1px solid rgba(82, 168, 236, .75);}

Couldn't resolve host 'magento-community'

Use this in front of the extension key name:

http://connect20.magentocommerce.com/community/

Example:


http://connect20.magentocommerce.com/community/banner 

Wednesday, January 16, 2013

Writing to downloadable file in PHP


$text_to_write = 'Example text to be written to file';
$fwrt = fopen($path.'file.txt', 'w');
fwrite($fwrt,$text_to_write);
fclose($fwrt);
header('Content-type: text/plain');
header('Content-Disposition: attachment; filename="example.txt"');
readfile($path.'file.txt');
exit();    // if this line is not included entire page code will also be written into the file