Magento Forum

   
Contact us code within “easy tabs” not working on product view
 
srmobile
Sr. Member
 
Total Posts:  276
Joined:  2011-10-25
 

I hired someone to do some changes to our website and noticed after the project was completed that the contact us on a product view does not generate an email. I’m hoping that someone can spot what the problem is. I cannot get in touch with them any longer......

The tab works, but when you click “Submit” nothing happens and no email is generated. All proper contact locations in the backend have been checked and rechecked and then checked again.

<?php 
$_helper 
$this->helper('catalog/output');
$attrCode Mage::getStoreConfig('easy_tabs/custom/customtabid');
if(
$attrCode){
    $product 
$this->getProduct();
    
$attribute $product->getResource()->getAttribute($attrCode);
    if (
$attribute{
        $content 
$attribute->getFrontend()->getValue($product);
        if(!empty(
$content)){
            
echo '<div class="product-specs" style="display:none;">'
                
$_helper->productAttribute($this->getProduct(), $content$attrCode)
                . 
'</div>';
        
}
    }
}
?>
<div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>

<
form action="<?php echo $this->getFormAction(); ?>" id="contactForm" method="post">
    <
div class="fieldset">
    
<?php $getStreId Mage::app()->getStore()->getStoreId();?>
    <?php 
if($getStreId ==1){
        
echo $this->getLayout()->createBlock('cms/block')->setBlockId('custom-text-eng')->toHtml();
        
}else{
            
echo $this->getLayout()->createBlock('cms/block')->setBlockId('custom-text-fr')->toHtml();
            
}?>
    
        <?php 
/*?><h2 class="legend"><?php echo Mage::helper('contacts')->__('Contact Information') ?></h2><?php */?>
        
<ul class="form-list">
            <
li class="fields">
                <
div class="field">
                    <
label for="name" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Name'?></label>
                    <
div class="input-box">
                        <
input name="name" id="name" title="<?php echo Mage::helper('contacts')->__('Name') ?>" value="<?php echo $this->htmlEscape($this->helper('contacts')->getUserName()) ?>" class="input-text required-entry" type="text" />
                    </
div>
                </
div>
                <
div class="field">
                    <
label for="email" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Email'?></label>
                    <
div class="input-box">
                        <
input name="email" id="email" title="<?php echo Mage::helper('contacts')->__('Email') ?>" value="<?php echo $this->htmlEscape($this->helper('contacts')->getUserEmail()) ?>" class="input-text required-entry validate-email" type="text" />
                    </
div>
                </
div>
            </
li>
            <
li>
                <
label for="telephone"><?php echo Mage::helper('contacts')->__('Telephone'?></label>
                <
div class="input-box">
                    <
input name="telephone" id="telephone" title="<?php echo Mage::helper('contacts')->__('Telephone') ?>" value="" class="input-text" type="text" />
                </
div>
            </
li>
            <
li class="wide">
                <
label for="comment" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Comment'?></label>
                <
div class="input-box">
                    <
textarea name="comment" id="comment" title="<?php echo Mage::helper('contacts')->__('Comment') ?>" class="required-entry input-text" cols="5" rows="3"></textarea>
                </
div>
            </
li>
        </
ul>
    </
div>
    <
div class="buttons-set">
        <
class="required"><?php echo Mage::helper('contacts')->__('* Required Fields'?></p>
        <
input type="text" name="hideit" id="hideit" value="" style="display:none !important;" />
        <
button type="submit" title="<?php echo Mage::helper('contacts')->__('Submit') ?>" class="button"><span><span><?php echo Mage::helper('contacts')->__('Submit'?></span></span></button>
    </
div>
</
form>
<
script type="text/javascript">
//<![CDATA[
    
var contactForm = new VarienForm('contactForm'true);
//]]>
</script>

This is within the file that is called when you click on a Templates Master Easy Tabs module.

Thanking you in advance,

SR

 
Magento Community Magento Community
Magento Community
Magento Community
 
srmobile
Sr. Member
 
Total Posts:  276
Joined:  2011-10-25
 

Okay I have a clue as to what is going on!

I tried running the code for a contact us form in a CMS page, when I hit the submit button it redirects to a non existing page because my magento site is within a installation of another directory.

So example:

http://www.example.com is one website.

http://www.example.com/shop is my magento installation

This is probably what is happening so I guess I need to create a redirect to the correct location (ie /shop) in the above mentioned code.

Many thanks!

SR

 
Magento Community Magento Community
Magento Community
Magento Community
 
srmobile
Sr. Member
 
Total Posts:  276
Joined:  2011-10-25
 

Here is an image.

As you can see when I hover over submit, it is incorrectly linking to http://www.mysite.com/contacts/index/post and not http://www.mysite.com/shop/contacts/index/post

Thanks,

SR

Image Attachments
contact.png
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top