Archive for April, 2013

Display Attribute label – and Attribute value in magento

To display attribute label:
$_product->getResource()->getAttribute('my_attribute')->getStoreLabel();
and attribute value:
getAttributeText('my_attribute'); ?>

thanks
for more info visit mage-people

Saving problem for Large Number of Attribute Option Labels in Magento

I had a problem (POST truncated) today and it comes from a too little POST limit. (or the standard PHP post_max_size)

i solved it with changing php.ini

max_input_var=1000
to
max_input_var=10000

you can try if you have same problem.

thanks
for more info visit mage-people

How to Translate Text in Magento

1. Add the following code inside your custom module config.xml

    
<frontend>
    <translate>
        <modules>
            <Modulename>
                <files>
                    <default>Translation.csv</default>
                </files>
            </Modulename>
        </modules>
    </translate>
</frontend>
        
    

2. Put Your Translation.csv inside app/locale/[your package]/

3. Use following code to translate it in frontend .

	
<?php
echo Mage::helper('modulename')->__('text to translate');
?>

4. This is how your csv file should be .

“test to be translate”,”translating text”

and so on.

thanks

for more info visit mage-people