Archive

Posts Tagged ‘Magento’

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>

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: Magento Tags: , ,

Magento Customer Details From Order Id

<?php $order = Mage::getModel(‘sales/order’)->load($this->getOrderId()); ?>
<?php $orderData = $order->getData(); ?>
<?php echo $orderData['customer_firstname']; ?>
<?php echo $orderData['customer_email']; ?>

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: Magento Tags: , , ,

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>

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: Magento Tags: , ,

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>

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: Magento Tags: , ,

Get all options of a specific attribute Magento

<?php
$attribute = Mage::getModel(‘eav/config’)->getAttribute(‘catalog_product’, ‘color’);
foreach ($attribute->getSource()->getAllOptions(true) as $option) {
echo $option['label'] . ‘ ‘ . $option['value'] . “<br />”;
}
?>

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: Magento Tags: , ,

Get configurable products attributes Magento

<?php
$obj = Mage::getModel(‘catalog/product’);
$_product = $obj->load(19);
$configurableAttributeCollection=$_product->getTypeInstance()->getConfigurableAttributes();
foreach($configurableAttributeCollection as $attribute){
echo “Attr-Code:”.$attribute->getProductAttribute()->getAttributeCode() .” – “;
echo “Attr-Label:”.$attribute->getProductAttribute()->getFrontend()->getLabel().” – “;
echo “Attr-Id:”.$attribute->getProductAttribute()->getId().” <br /> “;
}
?>

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare

Set Limit For Collection Magento

Use ->setPageSize($limit)

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: Magento Tags: , , ,

How to get the page identifier – Magento

echo $currentPage  = Mage::getBlockSingleton(‘cms/page’)->getPage()->getIdentifier();

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: Magento Tags: ,

Switch to our mobile site