0

On my Porto theme with Magento 1.9.2.2, Currency Switcher is not working on category_list page and product_view page. On both of these pages, switching the currency always returns Base Currency. Using the URL like this

http://example.com/catalog/category/view/id/82 (working well)

works fine i.e., the currency changed. Also getting the visitor's information using following method returns the array with information.

Mage::getSingleton('core/session')->getVisitorData();

But with the URL with URL key doesn't work. and getVisitorData() returns NULL value on the links with URL-key like following.

http://example.com/category.html (doesn't work)

Please help me to figure this out. Thanks in advance :)

0

hello @Muhammad Salid,

Why you don't use a extension for it ?

For example: http://goo.gl/LUpfa3

  • thanks @michel but the extension is paid. Also I just want to run the default functionality first. – saiid May 13 '16 at 5:23
0

AFAIK the visitor data is set in the session in

Mage_Log_Model_Visitor::saveByRequest

public function saveByRequest($observer)
{
    if ($this->_skipRequestLogging || $this->isModuleIgnored($observer)) {
        return $this;
    }

    try {
        $this->setLastVisitAt(now());
        $this->save();
        $this->_getSession()->setVisitorData($this->getData());
    } catch (Exception $e) {
        Mage::logException($e);
    }
    return $this;
}

You've got three things to debug.

  1. Is your module ignored? Pop logging in the isModuleIgnored function.
  2. Is the _skipRequestLogging set to true? It seems to be based on config and depending on the user agent. See Mage_Log_Model_Visitor::_construct.
  3. Is there some sort of exception happening, check your exception log.

It's going to be one of these failing. My bet would be on points 1 or 2 but that's pure conjecture.

  • Thanks @Luke 1) isModuleIgnored returns False and 2) _skipRequestLogging set to False. Also No exception in exception.log – saiid May 16 '16 at 7:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.