Mygento_Geoip_AjaxController::setAction()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
cc 3
nc 3
nop 0
1
<?php
2
3
/**
4
 *
5
 *
6
 * @category Mygento
7
 * @package Mygento_Geoip
8
 * @copyright 2014 NKS LLC. (https://www.mygento.ru)
9
 */
10
class Mygento_Geoip_AjaxController extends Mage_Core_Controller_Front_Action
11
{
12
13
    public function indexAction()
14
    {
15
        $this->getResponse()->setBody('Nope. Visit <a href="http://www.mygento.ru/">Magento development</a>');
16
    }
17
18
    public function setAction()
19
    {
20
        if ($this->getRequest()->isPost()) {
21
            $postData = Mage::app()->getRequest()->getPost();
22
            if (isset($postData['city'])) {
23
                Mage::helper('geoip')->setCity($postData['city']);
24
            }
25
        }
26
    }
27
}
28