In controller file I put this,
$result = "success";
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
How to fetch output in phtml file?
controllersmagento-1.9phtml
In controller file I put this,
$result = "success";
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
How to fetch output in phtml file?
Best Answer
Here i am showing you sample example using ajax request with json responsce
Template file: /app/design/frontend/rwd/default/template/pay/index.phtml
IndexController.php /app/code/local/Excellence/Pay/controllers/IndexController.php
Note: Please try this code in default magento and custom module. thanks