0

I have a custom contact form on the product view, so a customer can ask a question for a specific product. In the form I have a hidden text field with the current URL, so we know which product the question is for.

I've given the field the name producturl ...

$currentUrl     = Mage::helper('core/url')->getCurrentUrl();

<input name="producturl" id="producturl" title="<?php echo $this->__('Product URL') ?>" value="<?php echo $currentUrl; ?>" class="input-text disabled" type="text" disabled />

I would expect the Email Template to output this field using

{{var data.producturl}} 

since all other fields seem to work this way. Here is the Email Template:

Name: {{var data.name}} E-Mail-Adresse: {{var data.email}} Telefon: {{var data.telephone}} Bemerkungen: {{var data.comment}}  Produkt: {{var data.producturl}}

Everything seems to be working, the email is sent and all the info is given out in the template apart from the producturl field. Can anyone give me a reason as to why this is?

Thanks in advance.

1 Answer 1

0

Ok, this is weird, but I have found out that a form field that is marked as 'disabled' will not be output in the $data.

Changing the input field from

<input name="producturl" id="producturl" title="<?php echo $this->__('Product URL') ?>" value="<?php echo $currentUrl; ?>" class="input-text disabled" type="text" disabled />

to

<input name="producturl" id="producturl" title="<?php echo $this->__('Product URL') ?>" value="<?php echo $currentUrl; ?>" class="input-text disabled" type="text" />

made the value appear in the email template.

Maybe this will be helpful for others.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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