Hello from Magento beginer,i'm poor in knowledge of terms and names but i will try hard to explain this as much clear as i can.
I'm currently working on configuration of Magento Contact Form to be able to collect some data from users on Product View Page.
To be more interesting, the form will have also to send some data about the product on which page admin puts it, concretely Product name
Not all products will have this form, only products that are available for supply in different (currently unavailable) colors and sizes.
I copied Magento Contact Form to my Layout->Templates->contact->form.phtml
. Embedded it in one of the products page, putting in :
Magento Admin Panel-Catalog-Menage Categories-OneOfTheProducts-edit-Custom layout update
folowing reference xml:
<reference>
<block type="core/template" name="customer_request"
template="contacts/form.phtml"/>
</reference>
Tested it and it works, still admin has to do this xml placing in many products Custom layout update text box, but that's not part of this question.
Magento form has following fields: name, email, telephone, comment.
However i need to send one more parameter to postAction
action of Mage_Contacts_IndexController
, and that is Product name.
QUESTION
How can i obtain Product name in Contact form from Product page, can this child block element be aware of Page content in which is being embedded? Is there some global function in Magento i can use and how to pass this parameter to controller, should i use hidden input field or else...?
Any reference or code snippet will mean a world to me