About Filter again :)

  • Posts: 177
  • Thank you received: 5
11 years 6 months ago #100568

1. Create custom field



2. Create Filter with this Custom field


3. Create test category and products with this Custom field. Product 1 & 2 with "Test 1" value and Product 3 with "Test 2" value




4. Apply filter on a site page



It works, when I press for example "Test 1" in filter module. It shows Product 1 and Product 2. But how to delete filtering and show all 3 products again?

Please Log in or Create an account to join the conversation.

  • Posts: 177
  • Thank you received: 5
11 years 6 months ago #100570

I thought it's "Deletable filter" option, but it's set in Yes and nothing changed.

Please Log in or Create an account to join the conversation.

  • Posts: 177
  • Thank you received: 5
11 years 6 months ago #100571

And second part. When I use filter, I can't understand then what option I selected: Test 1, Test2 or Test 3. Can it change color, or maybe display pic near selected filter option or something else?

Last edit: 11 years 6 months ago by alikon1.

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
11 years 6 months ago #100592

Hi,

1. Regarding the "deletable filter", if that option is turned on, when a filter has been used, there is a delete icon next to it in order to cancel the filter.

2. The filter will just search for products which have a chosen "characteristics/configurations".

Please Log in or Create an account to join the conversation.

  • Posts: 177
  • Thank you received: 5
11 years 6 months ago #100596

Mohamed Thelji wrote: Hi,

1. Regarding the "deletable filter", if that option is turned on, when a filter has been used, there is a delete icon next to it in order to cancel the filter.

2. The filter will just search for products which have a chosen "characteristics/configurations".


But as you can see on the last screenshot, there is no any delete icon near "Test 1" option :(

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
11 years 6 months ago #100615

I tested it and it seems to be working fine for me, did you used your filter ? the delete icon will show only if your filter has been used.

Please Log in or Create an account to join the conversation.

  • Posts: 177
  • Thank you received: 5
11 years 6 months ago #100639

Mohamed Thelji wrote: I tested it and it seems to be working fine for me, did you used your filter ? the delete icon will show only if your filter has been used.

I think it has been used. Because when I click "Test 1", it shows "Test product 1" and "Test product 2". When click "Test 2", it shows only "Test product 3", as I need.

Hard to understand how to config it correctly :(

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
11 years 6 months ago #100738

I think that you should maybe try it again with the type of your filter set to checkbox :).

The following user(s) said Thank You: alikon1

Please Log in or Create an account to join the conversation.

  • Posts: 177
  • Thank you received: 5
11 years 6 months ago #100793

Mohamed Thelji wrote: I think that you should maybe try it again with the type of your filter set to checkbox :).

Thank you. As checkbox I can delete it.

And now can I do this?:



When click in filter -> Show in main part, what I selected in Filter.
And second: do not hide other options in filter. So I always can change it by one click (not first delete filter and select again).

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 177
  • Thank you received: 5
11 years 6 months ago #100812

Type "List" do not hide other options, but there is no Delete button.
Type "Chekbox" hide other options, but there is Delete button.

But where is type, which do not hide other options and has Delete button?) :ohmy:

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
11 years 6 months ago #100837

The best solution would be to use the list or checkbox type without the "deletable filter", regarding the "reset" button you can eventually edit the code of filters, but it would require some php knowledge.

Ps: I also added the filter reset button to our todo list.

Please Log in or Create an account to join the conversation.

  • Posts: 177
  • Thank you received: 5
11 years 6 months ago #100923

The list or checkbox type without the "deletable filter" hasn't visible signs what the customer had selected in the filter. It confuses the customer :(

Is it hard to make selected option in filter bold or change color?

Last edit: 11 years 6 months ago by alikon1.

Please Log in or Create an account to join the conversation.

  • Posts: 177
  • Thank you received: 5
11 years 6 months ago #100928

Mohamed Thelji wrote: The best solution would be to use the list or checkbox type without the "deletable filter", regarding the "reset" button you can eventually edit the code of filters, but it would require some php knowledge.

Ps: I also added the filter reset button to our todo list.


Reset button I think I can do this way: create Custom field "All" and set it for every item. So, then in filter I'll have All, Test 1, Test 2, Test 3... options. And click on All will show all items.

:( but how to mark selected option in filter I can't understand.

Please Log in or Create an account to join the conversation.

  • Posts: 177
  • Thank you received: 5
11 years 6 months ago #100965

find in filter.php code and add $tsvet (css class). Now it changes color, when click :woohoo:

if($filter->filter_data=='custom_field' && empty($filter->filter_value)){
			$field=parent::getFields($filter, $datas);
			if(!empty($field)){
				if(is_array($field->field_value)){
					foreach($field->field_value as $key => $val){
						$tsvet='';
						$checked='';
						$deleteButton='';
						$input='';
						if(!empty($selected) && is_array($selected) && in_array($val[0], $selected)){
							$tsvet='class="filter_checked"';
							$checked='checked="checked"';
							if($type=='radio'){
								$deleteButton='  '.parent::getDeleteButton($filter, $divName, '', $html, '', true, 'field_'.$filter->filter_id.'_'.$key.'_'.$divName);
							}
						}
						if($type!='hidden') $input = '<INPUT '.$onClick.' '.$checked.' type="'.$type.'" style="color: red;" name="filter_'.$filter->filter_namekey.$tab.'" value='.$val[0].' id="field_'.$filter->filter_id.'_'.$key.'_'.$divName.'">';
						$html.='<div class="hikashop_filter_checkbox">'.$input.'<label ' .$tsvet. ' for="field_'.$filter->filter_id.'_'.$key.'_'.$divName.'">'.$val[1].'</label>'.$deleteButton.'</div>'.$br;
					}
				}
			}
		}

Last edit: 11 years 6 months ago by alikon1.

Please Log in or Create an account to join the conversation.

Time to create page: 0.124 seconds
Powered by Kunena Forum