Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Adding contact form to sub-category
 
malpayne
Jr. Member
 
Total Posts:  15
Joined:  2008-11-23
 

I need help with this: I created a Help and Info category with four sub-categories of About Us, Contact Us, Customer Service, and Site Map. About Us and Customer Service were simple as they are already static blocks, but I am having trouble with the contact form. I created a static block for it and can load the form using the following code for the block content:

{{block type="core/template" name="contactForm" template="contacts/form.phtml"}}

The form does load from the navigation, but does not post when the Submit button is selected. (When you submit the form, it just reloads the form.) Any idea of how to resolve this?

I have too many other categories to display to have just have the Contact link changed from a footer link to a top link and would really perfer to have it as a sub-category.

Any suggestions on how to add the Site Map to a sub-category would be greatly appreciated as well. Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
malpayne
Jr. Member
 
Total Posts:  15
Joined:  2008-11-23
 

Okay, I did figure this out. For the static block that is linked to the contact category, I loaded the necessary code from the form.phtml as follows:

<div class="page-head">
</
div>
<
div class="clear">
                </
div> <form id="contactForm" method="post" action="{{store url=""}}/contacts/index/post/">
    <
fieldset class="group-select">
        <
h3 class="legend">Contact Information</h3>
        <
ul>
        <
li>
 <
div class="input-box">
                    <
label for="name">Name <span class="required">*</span></label><br/>
                    <
input name="name" id="name" title="Name" value="" class="required-entry input-text" type="text"/>
                </
div>

                <
div class="input-box">
                    <
label for="email">Email <span class="required">*</span></label><br/>
                    <
input name="email" id="email" title="Email" value="" class="required-entry input-text validate-email" type="text"/>
                </
div>

                <
div class="clear"></div>

                <
div class="input-box">
                    <
label for="telephone">Telephone </label><br />
                    <
input name="telephone" id="telephone" title="Telephone" value="" class="input-text" type="text"/>
                </
div>

                <
div class="clear"></div>

                <
div class="input-box">
                    <
label for="comment">Comment </label><br />
                    <
textarea name="comment" id="comment" title="Comment" class="input-text" style="height:150px;width:525px;" cols="50" rows="5"></textarea>
                </
div>
                </
li>
                </
ul>
    </
fieldset>
    <
div class="button-set">
        <
class="required">* Required Fields</p>
        <
button class="form-button" type="submit"><span>Submit</span></button>
    </
div>
</
form>
<
script type="text/javascript">
    var 
contactForm = new VarienForm('contactForm'true);
</script>

Hope this helps anyone trying to do the same…

 
Magento Community Magento Community
Magento Community
Magento Community
 
PatrickCM
Member
 
Total Posts:  54
Joined:  2008-09-07
 

Hi,

I copied your code in the Contact Us page, but still I can’t receive any email from the form.
The confirmation order emails work instead.. so it is something wrong with the form…

Do you maybe know why ?

thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
xitch
Member
 
Total Posts:  54
Joined:  2008-10-21
 

Thanks so much for this!  The only thing I found caused a problem for me was:

action="{{store url=""}}/contacts/index/post/">

I just changed it to:

action=/contacts/index/post/>

and it worked brilliantly!  Thanks :D

 
Magento Community Magento Community
Magento Community
Magento Community
 
newbie_06
Jr. Member
 
Total Posts:  2
Joined:  2010-10-16
 

Hi,

I tried all of the above and my contact form is working fine now. The only hitch is, after getting the Thank you for submitting message, the page gets redirected to the homepage of my website. And this happens so fast that the user might not be able to even read the Thank you message.

Any reason why this is happening?

I am a newbie at this, so please explain accordingly.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top