Zen Cart Logo
Forums / Addon Sideboxes / product filter module addon

product filter module addon

Views: 81,446

Results 141 to 160 of 169
27 Apr 2011, 6:08 PM
#141
zskiman avatar

zskiman

New Zenner

Join Date:
Mar 2005
Posts:
69
Plugin Contributions:
0

product filter module addon

so the goal is to take this code:

	$content .= zen_draw_pull_down_menu('categories_id', zen_get_categories(array(array('id' => '', 'text' => PRODUCT_FILTER_TEXT_ALL_CATEGORIES)), '0' ,'', '1'), (isset($_GET['categories_id']) ? $_GET['categories_id'] : ''), '') . zen_hide_session_id();

and populate it to pull just the current category

28 Apr 2011, 2:55 PM
#142
zskiman avatar

zskiman

New Zenner

Join Date:
Mar 2005
Posts:
69
Plugin Contributions:
0

Re: product filter module addon

ok got this to work where it will only search the catagory that its displayed on

take this line (around 18) in includes\templates\TEMPLATE\sideboxes\ tpl_product_filter.php

$content .= zen_draw_pull_down_menu('categories_id', zen_get_categories(array(array('id' => '', 'text' => PRODUCT_FILTER_TEXT_ALL_CATEGORIES)), '0' ,'', '1'), (isset($_GET['categories_id']) ? $_GET['categories_id'] : ''), '') . zen_hide_session_id();

and replace with

    $content .= zen_draw_pull_down_menu('categories_id',zen_get_categories(array(array('id' => $current_category_id, 'text' => $current_category_id)), '0' ,'', '1'),(isset($_GET['$cPath']) ? $_GET['cPath'] : ''), '') . zen_hide_session_id();

NOTE* -- If you set your catagories display to false in product_filters_define.php it WILL NOT WORK

now just to find a way to make the catagories dropdown box dissappear from the form?

29 Apr 2011, 7:28 PM
#143
zskiman avatar

zskiman

New Zenner

Join Date:
Mar 2005
Posts:
69
Plugin Contributions:
0

Re: product filter module addon

was able to hide not wanted attributes from showing up in dropdowns :)

also changed the sort order of items in dropdowns to match ranges set by product options value

still need to find a way to hide the catagories box without setting to false !!

to hide attributes from showing on form

  1. set attributes to sort order of 500 or some other high # you will never plan to use.

2)in file tpl_product_filter.php

find:

$option_names = $db->Execute("SELECT products_options_id,products_options_name FROM ". TABLE_PRODUCTS_OPTIONS);

replace with:

$option_names = $db->Execute("SELECT products_options_id,products_options_name FROM " . TABLE_PRODUCTS_OPTIONS . " WHERE products_options_sort_order = 500"); 

to change sort order make sure you add your option values in the order you want them to show (this works by options id #)

after:

$options_array = array_pad($options_array,sizeof($options_array )+1,array("id"=>$option_names_values->fields['products_options_values_id'],"text"=>$option_names_values->fields['products_options_values_name']));

add:

sort($options_array);

any help with hiding the catagories box would deffinatly be appreciated and is the last thing needed to make this work 100%

thanx
Mike

3 May 2011, 10:27 AM
#144
bonnit avatar

bonnit

Zen Follower

Join Date:
Jun 2009
Location:
Kent, UK
Posts:
350
Plugin Contributions:
0

Re: product filter module addon

i have a question related to this mod, i have it working on my site but i also have four navigation links underneath my category links, which are pre defined searches,

for example:

http://www.livvylou.co.uk/index.php?main_page=advanced_search_result&inc_subcat=1&pfrom=0&pto=10&sort=3a
http://www.livvylou.co.uk/index.php?main_page=advanced_search_result&inc_subcat=1&pfrom=10&pto=20&sort=3a

they basically do a search for product price ranges for customers. upon clicking these a customer is displayed the results of the search and this is where my problem is, even though the sorter box is displayed at the top of each page it is unuseable, as upon clicking any of the options in the sorter i am taken to an advanced search page which states no products have been found (ie if i search under £10, then try to sort by price)

do you have any idea what is going wrong here or at worst how to turn it off just on those pre defined search pages?

i have posted a thread here: http://www.zen-cart.com/forum/showthread.php?t=179081 but didnt receive a reply. i would love it if anyone could help :)

19 Jun 2011, 9:30 PM
#145
thewebdot avatar

thewebdot

New Zenner

Join Date:
May 2011
Posts:
2
Plugin Contributions:
0

Re: product filter module addon

Is there any way to show only cretin Option Names ?

I have tried to select only 2 id`s from 3
here is the code (tpl_product_filter.php)

if(SHOW_ATTRIBUTES){
$db->Execute("SELECT products_options_id,products_options_name FROM ". TABLE_PRODUCTS_OPTIONS ." WHERE products_options_id = '1' OR products_options_id = '3'");
while (!$option_names->EOF) {

    $options_array = array ();
    $option_names_values = $db->Execute("select pov.products_options_values_id, pov.products_options_values_name from ". TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS." povp,".TABLE_PRODUCTS_OPTIONS_VALUES." pov WHERE povp.products_options_values_id = pov.products_options_values_id AND povp.products_options_id = '".$option_names->fields['products_options_id']."'");
		while (!$option_names_values->EOF) {
			$options_array = array_pad($options_array,sizeof($options_array )+1,array("id"=>$option_names_values->fields['products_options_values_id'],"text"=>$option_names_values->fields['products_options_values_name']));
			$option_names_values->MoveNext();
		}

    $content .= '<div>'.$option_names->fields['products_options_name'].'</div>';
    $content .= zen_draw_pull_down_menu('options_'.$option_names->fields['products_options_id'], $options_array, (isset($_GET['options_'.$option_names->fields['products_options_id']]) ? $_GET['options_'.$option_names->fields['products_options_id']] : ''), 'onclick="javascript:document.product_filter_from.submit()" size="3"') . zen_hide_session_id();
	$option_names->MoveNext();
	}  	
}

:oops:
But there seams to be an error any help ??

27 Jun 2011, 10:10 PM
#146
jjrmy1 avatar

jjrmy1

New Zenner

Join Date:
Apr 2010
Posts:
23
Plugin Contributions:
0

Re: product filter module addon

Nice mod to this mod zskiman. Thanks for sharing. I don't know much more that squat about ,php but wouldn't there be a way to make the categories field some sort of "hidden field".

Cheers - and thanks

7 Jul 2011, 8:11 PM
#147
mr_g avatar

mr_g

New Zenner

Join Date:
Jul 2011
Posts:
3
Plugin Contributions:
0

Re: product filter module addon

Hi

I'm using v1.3.9h

I can't seem to get the price filter and product order to work.

I have an additional attribute "era" which does work though.
(I've only added this attribute to one product so far. Product #001 has era set to 40s)

The site i'm working on is still in progress but you can see it here:
http://theavintage.com/index.php?main_page=index&cPath=1

I have made changes from earlier posts to get to this stage but I have no idea what I have no idea what is going wrong as i'm not getting any errors.

Any help would be much appreciated.

7 Jul 2011, 8:28 PM
#148
mr_g avatar

mr_g

New Zenner

Join Date:
Jul 2011
Posts:
3
Plugin Contributions:
0

Re: product filter module addon

Mr_G:

Hi

I'm using v1.3.9h

I can't seem to get the price filter and product order to work.

I have an additional attribute "era" which does work though.
(I've only added this attribute to one product so far. Product #001 has era set to 40s)

The site i'm working on is still in progress but you can see it here:
http://theavintage.com/index.php?main_page=index&cPath=1

I have made changes from earlier posts to get to this stage but I have no idea what I have no idea what is going wrong as i'm not getting any errors.

Any help would be much appreciated.

I've got slightly further.

I changed

the line

$enable_attribute_filter = false ;

to

$enable_attribute_filter = true ;

in \includes\modules\pages\product_filter_result\header_php.php

but now when i select a price range i always get

"No products listed for you criteria! Please try again."

which i defined for TEXT_NO_PRODUCTS

15 Jul 2011, 1:15 AM
#150
fietsrek avatar

fietsrek

New Zenner

Join Date:
Jan 2011
Posts:
21
Plugin Contributions:
0

Re: product filter module addon

Hi,

Is there a way to use price range, but then for an attribute? So for example using size range?

Thanks in advance!

25 Sep 2011, 9:25 PM
#151
ferisk avatar

ferisk

New Zenner

Join Date:
Sep 2011
Location:
Slovakia
Posts:
11
Plugin Contributions:
0

Re: product filter module addon

similar filter for ZenCart
about commercial

sumo.sk

:unsure:

5 Oct 2011, 12:37 AM
#152
forzaparma1 avatar

forzaparma1

New Zenner

Join Date:
Oct 2011
Posts:
1
Plugin Contributions:
0

Re: product filter module addon

FeriSK:

similar filter for ZenCart
about commercial

sumo.sk

:unsure:

I've just been wondering is it possible to combine that aspect with this current module without breaking things too much.

On my site I am looking to have two more filter options beside the "Filter results by: Products starting with..." These would be pulled from two attributes which can be seen on the sidebar of

http://gamersworlddublin.com/index.php?main_page=index&cPath=65_66&sort=20a&alpha_filter_id=0

I'm guessing its not just a simple case of pasting the relevant dropdown menu code into the product listing template file. (I'm sorry for my vagueness I'm just really starting out with Zen Cart).

Thank you for this absolutely huge thread of information it's been of great help so far :clap:

17 Oct 2011, 8:05 PM
#153
fariba avatar

fariba

New Zenner

Join Date:
Jun 2010
Location:
London
Posts:
39
Plugin Contributions:
0

Re: product filter module addon

Hi All,

I have installed the module successfully but I really need two things to be done :cry:

1: I would like to add the text in front of the drop down instead of inside the drop down in my side box... I went through the file in include/template/custom/sideboxes/ and try everything but I wasn't successful to add this texts...

2: When I search the result are correct but the images it shows is the main image of the product not the image witch match the attribute.. for example if I had a shoe called Sara under Catalog/categories/products and I uploaded with an image(in red for example) and this shoe has the other colours green and blue and they have got their own images, when I search for blue shoes the Sara will come up with the Red image not the Blue one ...

I did what ever I thought that might help me but still no chance:censored:

I really wants to know if anyone else has got this issues or can help me to sort these issues out ...

any little help would be so appreciated :blush:

20 Nov 2011, 11:09 AM
#154
eranariel avatar

eranariel

Zen Follower

Join Date:
Dec 2010
Location:
NYC
Posts:
104
Plugin Contributions:
4

Re: product filter module addon

Hello Zenners,

As Zen Cart does not support dependent attributes, I have to create separate groups of attributes for 4 distinct product categories, however, it does not make sense that they all show up in the filter by attributes side box...

Is there anyway to remove an attribute from appearing in the sidebox?

Please advise!!

SOS!!!

26 Nov 2011, 9:00 AM
#155
blondu avatar

blondu

New Zenner

Join Date:
Oct 2011
Location:
Romania
Posts:
9
Plugin Contributions:
0

Re: product filter module addon

... bad post

3 Dec 2011, 8:27 PM
#156
the_sr5 avatar

the_sr5

New Zenner

Join Date:
Dec 2011
Posts:
6
Plugin Contributions:
0

Re: product filter module addon

I've been reading through the forum and havent figured out how do achieve this yet, any help would be appreciated, I have the filter working by attributes and so forth but where i have the error is if you look at this page http://hardcorehobby.net/index.php?main_page=index&manufacturers_id=1 where you see the filter by: All Categories you will see two Buggy sections well the reason for that is that one is in Gas Off-Road > 1/8 Scale > Buggy and the other is in Electric Off-Road > 1/10 Scale > Buggy or vice versa cant remember at this point but what i want to do is in that drop down display the full link hence: RC Cars > Gas Off-Road > 1/10 Scale > Buggy... how would i go about achieving this?

Thanks in Advance!

26 Jan 2012, 3:57 AM
#157
brians34 avatar

brians34

New Zenner

Join Date:
Oct 2009
Posts:
34
Plugin Contributions:
0

Re: product filter module addon

This has probably been asked and answered in this thread, but to save a little time, I'm asking again.

All that is in the READ ME text is this:

Add to english.php following lines:

// pro_vyhledavani
define('TABLE_HEADING_IMAGE', 'Image');
define('TABLE_HEADING_PRICE', 'Price');
define('TEXT_NO_PRODUCTS', 'No products for you criteria! Please try again.');

Ok, so here's my questions and assumptions.

I take it that I only need to transfer the contents of the product_filter's includes folder into my store's includes folder. Is this correct?

Then from the READ ME text, can that code be added anywhere in the english.php file or do I need to add it to a specific place?

Lastly, in the READ ME text can I change 'No products for you criteria! Please try again.' TO 'No products for your criteria! Please try again.' without causing a problem?

1 Feb 2012, 6:42 AM
#158
4jdesigns avatar

4jdesigns

Zen Follower

Join Date:
Jul 2011
Posts:
106
Plugin Contributions:
0

Re: product filter module addon

@brians34

Yes, that's correct. I added mine below the similar looking code to make it easier to find if need be. And Yes you can change the text, but makes sure you keep it within the apostophes/ quotes(' '). Only problem you'll face is if you change 'TEXT_ON_PRODUCTS' as this is the name of your "shortcut" (one for a better word).

Hope this helps.

Jay.

1 Feb 2012, 6:51 AM
#159
4jdesigns avatar

4jdesigns

Zen Follower

Join Date:
Jul 2011
Posts:
106
Plugin Contributions:
0

Re: product filter module addon

Hello All,

I have 2 questions regarding the Product Filter module:

1.) Is there a way that I can hide the attributes until the category is selected?

and...

2.) Once the category is selected, could it then only show the attributes that are relevant to that category?

Scenario:

I have 2 categories, washing machines & fridges. Washing machines has an attribute 'load weight' & 'Spin rpm' whilst fridges has 'ice box'. I would like when fridges selected to only show 'icebox' attribute and when washing machine is selected only show 'load' & 'spin'.

Is this possible or is there a better way to filter products in this way?

Thanks if anyone can help,
Jay.

7 Feb 2012, 1:32 PM
#160
19gary72 avatar

19gary72

New Zenner

Join Date:
Nov 2010
Posts:
32
Plugin Contributions:
0

Re: product filter module addon

Running Zen 1.3.9h

I'm sorry if this is already repeated, but I installed this module, and each time the 'Go' button is hit, an error appears.. Here is what is appearing..

1146 Table 'buybench_zc1.zs_products_attributes' doesn't exist
in:
[select count(distinct p.products_id) as total FROM zen_products p, zen_products_description pd, zen_products_to_categories p2c, zen_products_attributes pa, zen_products_options po , zen_products_options_values pov WHERE (p.products_status = 1 AND ((pa.products_id In (SELECT pa.products_id FROM zs_products_attributes pa WHERE ( pa.options_id = 2 AND pa.options_values_id = 11 )))) AND p.products_id = pa.products_id AND p.products_quantity > 0 AND p.products_id = pd.products_id AND pd.language_id = 1 AND p.products_id = p2c.products_id) ]

Any help with what this could be, would be so greatly appreciated.
Gary