1

I want to display the company name by default inside the contact form. Just like the customer name and emailaddress.

I tried this, but that does not work.

<?php echo $this->escapeHtml($this->helper('contacts')->getCompany()) ?>

What line should I use?

  • try this Mage::app()->getStore()->getFrontendName() – Amit Bera Oct 16 '15 at 9:45
1

Pre-filled values for user email and name come from the contacts helper, if you take a look there, you will find those functions. To have user's comapny pre-filled too, you can try with something like this :

<?php
    if (!Mage::getSingleton('customer/session')->isLoggedIn()) {
        echo '';
    }
    else {
        $customer = Mage::getSingleton('customer/session')->getCustomer();
        echo trim($customer->getCompany());
    }
?>

directly inside your phtml file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.