From 2eae83066dab4041faebb36582a47f41c900030c Mon Sep 17 00:00:00 2001 From: Willem Wigman Date: Wed, 23 Sep 2015 21:29:03 +0200 Subject: [PATCH] Update AjaxController.php --- .../controllers/AjaxController.php | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/app/code/community/Wigman/AjaxSwatches/controllers/AjaxController.php b/app/code/community/Wigman/AjaxSwatches/controllers/AjaxController.php index fe42c81..203caca 100644 --- a/app/code/community/Wigman/AjaxSwatches/controllers/AjaxController.php +++ b/app/code/community/Wigman/AjaxSwatches/controllers/AjaxController.php @@ -1,20 +1,12 @@ _request = Mage::app()->getRequest()->getParams(); -} - public function updateAction(){ -if(!isset($this->_request['pid'])) { return; } +if(!Mage::app()->getRequest()->getParam('pid')) { return; } -$pid = $this->_request['pid']; +$pid = Mage::app()->getRequest()->getParam('pid'); $_product = Mage::getModel('catalog/product')->load($pid); //get Product @@ -54,18 +46,18 @@ public function updateAction(){ public function getlistdataAction(){ -if(!isset($this->_request['pids'])) { return; } +if(!Mage::app()->getRequest()->getParam('pids') { return; } if (!Mage::helper('configurableswatches')->isEnabled()) { // check if functionality disabled return; // return without loading swatch functionality } -$pids = explode(',',$this->_request['pids']); +$pids = explode(',',Mage::app()->getRequest()->getParam('pids')); $response = $swatches = $jsons = array(); $this->loadLayout(); -$viewMode = (isset($this->_request['viewMode']))? $this->_request['viewMode'] : 'grid'; +$viewMode = (Mage::app()->getRequest()->getParam('viewMode'))? Mage::app()->getRequest()->getParam('viewMode') : 'grid'; $keepFrame = ($viewMode == 'grid')? true : false; foreach($pids as $pid){ @@ -103,4 +95,4 @@ public function getlistdataAction(){ $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response)); } -} \ No newline at end of file +}