Category Archives: Magento

Magento Session

Set session
=========

$myData = ‘PHPCodez’;
Mage::getSingleton(‘core/session’)->setMydata($myData);

get session value
=========

$myData = ”;
$myData=Mage::getSingleton(‘core/session’)->getMyData();

Unset session
=========

Mage::getSingleton(‘core/session’)->unsMyData();

magento change form validation messages

1) Add a new class “over_all_fit_required_entry”
<input type=”hidden” name=”over_all_fit_selected” id=”over_all_fit_selected” class=”over_all_fit_required_entry”>

2) Add the below given code
<script type=’text/javascript’>
//< ![CDATA[
Validation.add(‘over_all_fit_required_entry’, ‘ Please select option’, function(v) {
return !Validation.get(‘IsEmpty’).test(v);
});
//]]>
</script>

Modify Page Title CMS Page Magento

Go to Admin > CMS > Pages > Design > Layout Update XML and paste the below given code

<reference name=”head”>
<action method=”setForcedTitle” translate=”title”>
<title>Account Settings</title>
</action>
</reference>
and modify the head.phtml

<title><?php echo ($this->getForcedTitle()) ? $this->getForcedTitle() : $this->getTitle() ?></title>

Modify Page Title Magento

Include the below given code in xml file

<reference name=”head”>
<action method=”setForcedTitle” translate=”title”>
<title>Account Settings</title>
</action>
</reference>
and modify the head.phtml

<title><?php echo ($this->getForcedTitle()) ? $this->getForcedTitle() : $this->getTitle() ?></title>