Hi - I added a new poll and deleted the original one. The poll works fine, gives the statistics but when I refresh the page the entire poll disappears from the page.
I tried this in both IE and Firefox.
Any ideas? Thanks -
I think I got this figured out. When you vote on a poll, that poll id is added to “voted poll id” list. When the page is refreshed, Magento looks for a poll that HASN’T been voted on! If it can’t find one (i.e. there is only one active poll), nothing shows. Here’s how I fixed it:
In the file app/code/core/Mage/Poll/Block/ActivePoll.php, comment out the $votedIds = $pollModel->getVotedPollsIds() line and add an empty array as follows:
$pollModel = Mage::getModel('poll/poll'); // get last voted poll (from session only) $pollId = Mage::getSingleton('core/session')->getJustVotedPoll(); if (empty($pollId)) { // get random not voted yet poll //$votedIds = $pollModel->getVotedPollsIds(); $votedIds = array(); $pollId = $pollModel->setExcludeFilter($votedIds) ->setStoreFilter(Mage::app()->getStore()->getId()) ->getRandomId(); } if (empty($pollId)) { return false; } $poll = $pollModel->load($pollId);
As I know, in admin panel it is possible to set configuration the way that customer can vote only once for particular IP address.
I am not sure what way it was done, but…
Did you check that after this modification this feature (voting only one time) is still works fine?
If it does, I think your modification should be included into the new version.
I think I got this figured out. When you vote on a poll, that poll id is added to “voted poll id” list. When the page is refreshed, Magento looks for a poll that HASN’T been voted on! If it can’t find one (i.e. there is only one active poll), nothing shows. Here’s how I fixed it:
In the file app/code/core/Mage/Poll/Block/ActivePoll.php, comment out the $votedIds = $pollModel->getVotedPollsIds() line and add an empty array as follows:
$pollModel = Mage::getModel('poll/poll'); // get last voted poll (from session only) $pollId = Mage::getSingleton('core/session')->getJustVotedPoll(); if (empty($pollId)) { // get random not voted yet poll //$votedIds = $pollModel->getVotedPollsIds(); $votedIds = array(); $pollId = $pollModel->setExcludeFilter($votedIds) ->setStoreFilter(Mage::app()->getStore()->getId()) ->getRandomId(); } if (empty($pollId)) { return false; } $poll = $pollModel->load($pollId);
Hi everyone. I am on 1.1.8 version, and the poll doesn’t show results once you vote. It seems to take the vote ok, but if I allow only one vote per IP address the poll disappears and nothing is displayed. If I allow multiple votes per IP, the poll is displayed again...no results!