Jump to content

Multiselect search?


hellomoto
 Share

Recommended Posts

I have the following sidebar.inc included on my Shop page which is the main index of items:

<?php

foreach($input->get as $key => $val) {
	echo htmlentities("$key = $val") . "<br>";
}

$selector = '';

$summary = array(
	"categories" => "",
	"agegroups" => "",
	"keywords" => "",
);

if($input->get->categories) {}

$sidebar = "<form id='search_form' method='get' action='{$config->urls->root}shop/'><div class='row'>";
$taxonomies = $pages->find("template=product_taxonomies");
foreach($taxonomies as $t) {

  $items = $t->children;
  $sidebar .= "<div class='small-6 large-12 columns'><h3>{$t->title}</h3>";
  foreach($items as $i) {

  	$sidebar .= "<input id='$i->name' name='$t->name' value='$i->name' type='checkbox'><label for='$i->name'>$i->title</label><br>";
  }
  $sidebar .= "</div>";

}

$sidebar .= "<input id='search_keyword' name='keyword' type='text'/>";

$sidebar .= "<div class='large-12 columns'><input type='submit' id='search_submit' name='submit' value='Search'></div></div></form>";

Checking more than one input of the same name only produces the last value of those. Can anyone advise me on how to make these multi-select filters return multiple values? 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...