Zen Cart Logo
Forums / General Questions / Poll on specific category id

Poll on specific category id

Views: 520

Results 1 to 2 of 2
30 Sep 2013, 6:35 AM
#1
perfumbg avatar

perfumbg

Zen Follower

Join Date:
May 2010
Posts:
192
Plugin Contributions:
5

Poll on specific category id

Hello,

I want to have polls on a specifica category pages in my cart.
For that i wantet to use POLL MANAGER from the download zone ...

I have inserted in table_poll -> p_catID
and added field to put the desired category id in /admin/poll_manager.php

But i just cant figure how to show the poll on the same category id that we enter in p_catID.

If someone knows the answer please help :)

Many regards.

30 Sep 2013, 6:48 AM
#2
perfumbg avatar

perfumbg

Zen Follower

Join Date:
May 2010
Posts:
192
Plugin Contributions:
5

Re: Poll on specific category id

I assume using a part from /modules/sideboxes/poll_box.php

in /templates/TEMPLATE/templates/tpl_index_product_list.php

using WHERE (p_catID = ' ".$_GET[cPath] ." ') instead of WHERE (r_ip IS NULL OR p_multivote='Y')

$session = zen_session_id();
if (!empty($session)) {
	
	// It's a real user. Now check if he/she has polls left to answer.
	$poll_query = $db->Execute("SELECT * FROM " . PM_TABLE_POLLS . " LEFT JOIN " . PM_TABLE_POLL_OPTIONS . " ON p_id=o_poll_id LEFT JOIN " . PM_TABLE_POLL_RESULTS . " ON (o_poll_id=r_poll_id AND r_ip='" . $_SERVER['REMOTE_ADDR'] . "') 

WHERE (p_catID = ' ".$_GET[cPath] ." ') 
AND p_status=1 ORDER BY p_id, o_id");
	

And from here on I just can't see the light :)