JQuery.Post() call to mvc controller from magento

2019-09-11 03:56发布

Im doing a little messing around and on a learning curve with Magento, Jquery and programming and looking for some guidance with an issue Ive been stuck on.

I want to post some information to a controller of my custom module from one of the steps during onepage checkout.

The article at the following link has helped me understand how I could possibly achieve this and have followed that guide to the point that I am stuck at right now but my post call is posting back to my magento homepage as opposed to my specified controller action.

http://www.atwix.com/magento/ajax-requests-in-magento/

I suspect I need to do this a little differently as I am trying to post back from onepage checkout. Can anyone point me in the right direction as to how I can make the jquery.post() call from onepage checkout to my magento controller action that is in my custom module ?

1条回答
老娘就宠你
2楼-- · 2019-09-11 04:31

jQuery isn't installed by default in Magento. Prototype is. You want to do this in your Javascript:

new Ajax.Request('<?php echo $this->getUrl('module/controller/action'); ?>');

Where module is the name of your Module and so on.

查看更多
登录 后发表回答