MAGENTO

Magento controller using ajax

Magento controller using ajax. Following is the complete tutorial.

By using ajax with magento controller using ajax you can handle a lot of ajax process like removing product from cart through ajax, customer login via ajax through popup, showing an instant order date anywhere etc. To start with ajax process we need to follow below steps.

magento controller using ajax
magento controller using ajax

Write a jquery ajax call in your template phtml file to invoke the action from controller.

Now write a controller in your magento module i.e, in app/code/local/package/modulename/controller/DataController.php

Before running javascript  test this controller by  hitting url like “http://www.domain.com/ module/data/getdata”. You should get the else part of the code “Nothing is received !”. Then run the js in phtml file and check console.




Share

Leave a Comment

Your email address will not be published. Required fields are marked *