Magento自定义页面-Ajax联系人


Magento Custom page - Ajax Contact

我希望在Magento自定义页面(从菜单访问)上有一个Ajax联系人表单,并希望在任何人填写详细信息时都能向所有者发送一封邮件。有模块吗?如果没有,构建这个的最佳方式是什么?

谢谢。

遵循步骤-

1) 通过Magento模块创建器创建模块。或者通过phtml文件按钮操作调用下面的ajax。

2) 在InexController.php文件中编写控制器操作。

 public function saveContactDetailsAction() {
    //get details
     $postData  = $this->getRequest()->getParam('data');
   //save data......
    return  "sucess"
   }

3) 在phtml文件中编写ajax代码。

   var reloadurl = '<?php echo $this->getUrl('module/index/saveContactDetails'); ?> ';
    new Ajax.Request(reloadurl, { 
        method: 'POST',
        parameters:id='paramater list with &',
        onComplete: function(transport) 
        { //write sucess code here },
        onFailure: function() 
        { 
           //write error code here
        }});

希望这能帮助