5
votes

I'm new to Magento, and i need some conceptual guide and/or references. I need to create custom form that will be a part of product-info page (at it's bottom) and that will collect user input (email, size, color). Only some product will have this feature/form (it's up to admin). So, goal of this form will be to email store-admin about a product that is available in stock but not in wished size and/or color. Should i customize existing Contact us form or should i create fresh custom form in new module?
Form should submit data to admin via email along with name of the product.

3
If you accept, I can offer only email option. I haven't got much time to write admin section code to show sent it by customer! - Oğuz Çelikdemir
@Oğuz Thx (Teşekkür ederim :)), that would help a lot! - maljukan
rica ederim :) ( means your welcome ) - Oğuz Çelikdemir
@Oğuz I'm currently trying to write code for custom email form, can you give me a hint how to get product Name so i could use it in email content or should i ask that in another question? - maljukan
you can use custom variables in email templates. Check admin > system menu. check this links Defining Transactional Variables or Transactional Emails - Oğuz Çelikdemir

3 Answers

1
votes

Sounds like you'll need a custom form. You'll need a new database table to store the data, a Model to represent the data, and a controller to post the form to at the very least. You'll probably want to add an attribute to Products which is a yes/no of whether to display the form. You'll also probably want to view the data, so you'll have to make pages in the admin site. Perhaps a grid of all answers and a page to view/edit a specific answer.

1
votes

Ok, so first create a .phtml file under app/design/frontend/[namespace]/[theme]/template/catalog/product/send_request.phtml

then, add this .phtml file reference in catalog.xml in /app/design/frontend/[namespace]/[theme]/layout/catalog.xml

<block type="core/template" name="customer_request" template="catalog/product/send_request.phtml"/>

below the : <label>Catalog Product View (Any)</label>

section but you should find to right section where to place ( you will find after a few try )

Finally, add your php logic into send_request.phtml file. The form contain that you implemented in send_request.phtml will available under product view page.

0
votes

There is a free extension available. You can use this extension and customize it according to your needs. Product Questions