简体   繁体   English

自定义联系表格给我404错误

[英]Custom contact form gives me 404 error

I've created a custom contact form for each magento product, I've set up all the files and inserted this code inside a Magento static block: 我为每个magento产品创建了一个自定义联系表单,设置了所有文件,并将此代码插入了Magento静态块中:

{{block type="core/template" form_action="/PersonalizzazioniEmail/index/post/"  template="catalog/product/view/form-personalizzazione.phtml"}}

Here's the form-personalizzazione.phtml 这是表单-personalizzazione.phtml

 <?php $productId=$this->getRequest()->getParams(); $model = Mage::getModel('catalog/product'); $_product = $model->load($productId["id"]); ?> <div id="messages_product_view"><?php echo $this->getMessagesBlock()->toHtml() ?></div> <div class="page-title"> <h1><?php echo Mage::helper('contacts')->__('Contact Us') ?></h1> </div> <form action="<?php echo $this->getFormAction(); ?>" id="contactForm" method="post"> <input type="hidden" id="product" name="product" value="<?php echo $_product->getName() ?>" /> <div class="fieldset"> <h2 class="legend"><?php echo Mage::helper('contacts')->__('Contact Information') ?></h2> <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('core')->quoteEscape(Mage::helper('contacts')->__('Name')) ?>" value="<?php echo $this->escapeHtml($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('core')->quoteEscape(Mage::helper('contacts')->__('Email')) ?>" value="<?php echo $this->escapeHtml($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('core')->quoteEscape(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('core')->quoteEscape(Mage::helper('contacts')->__('Comment')) ?>" class="required-entry input-text" cols="5" rows="3"></textarea> </div> </li> </ul> </div> <div class="fieldset privacy"> <ul class="form-list"> <?php if (Mage::helper('privacy')->isPrivacyEnabled()): ?> <li> <?php echo $this->getChildHtml('privacy.include.contacts'); ?> </li> <?php endif;?> </ul> </div> <div class="buttons-set"> <p 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('core')->quoteEscape(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> 

But I get a 404 error when I submit the form, what could be the reason? 但是提交表单时出现404错误,这可能是什么原因? Thanks 谢谢

Create a Custom Contact Form in Magento,Kindly visit below URLs. 在Magento中创建自定义联系表单,请访问以下URL。

http://inchoo.net/magento/magento-email/magento-custom-email-contact-form-with-notification-system/ http://inchoo.net/magento/magento-email/magento-custom-email-contact-form-with-notification-system/

http://ignaciogondra.com/2015/08/24/how-to-create-a-custom-contact-form-in-magento/ http://ignaciogondra.com/2015/08/24/how-to-create-a-custom-contact-form-in-magento/

If you don't want to use custom code,You can use this paid extension. 如果您不想使用自定义代码,则可以使用此付费扩展。

https://www.magentocommerce.com/magento-connect/custom-contact-forms.html https://www.magentocommerce.com/magento-connect/custom-contact-forms.html

You can also use this Product Question,It's might be fulfilled your requirement. 您也可以使用此产品问题,它可能已满足您的要求。 This is free extension. 这是免费的扩展程序。

https://www.magentocommerce.com/magento-connect/product-question-1.html https://www.magentocommerce.com/magento-connect/product-question-1.html

Hope It's helpful for you. 希望对您有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM