All posts by Pramod T P

getFormAction() return null value contact form magento

It may happen if we try to load contact form through a static block or cms .

When you  do so make sure that you have included ‘  form_action=”/contacts/index/post ‘ .ie The code will

be

{{block type=”core/template” name=”contactForm” form_action=”/contacts/index/post” template=”contacts/form.phtml”}}

But when we submit the contact form , the page will be redirected to the original contact form

“magento/contacts/ ” after sending the mail . To fix that we should  override the function “postAction” in

/var/www/html/app/code/core/Mage/Contacts/controllers/IndexController.php and edit the code

“$this->_redirect(‘*/*/’);” at line number 113 with the page url . ie for eg :

“$this->_redirect(‘contatcs’)

Modify XML node element value php

XML File – test.xml
===============
<?xml version=”1.0″ encoding=”UTF-8″?>
<PHPCodez>
<Update>
<Time>26</Time>
</Update>
</PHPCodez>

 

PHPCode

========

<?php
$xmlFIle    =       “test.xml”;
$xmlString       =  file_get_contents($xmlFIle);
$content=simplexml_load_string($xmlString);
echo $content->Update->Time;
$content->Update->Time = date(“Y-M-d h:i:s”);
$content->asXML($xmlFIle);
?>

Magento Compilation

It allows us to compile all files of magento installation in order to create a single include path to improve the performance

Before compiling the code make sure that “includes” and the file “includes/config.php” must both be writeable.

You can compile the code from the admin panel  System → Tools → Compilation

NoTE: Before you make any changes to your Magento installation you should always disable compilation. Once the changes are made, run the compilation process, and then enable it.