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 :)

2 Answers 2

0

hello @Muhammad Salid,

Why you don't use a extension for it ?

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

1
  • thanks @michel but the extension is paid. Also I just want to run the default functionality first. May 13, 2016 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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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