Searching by complex conditions, please help

Author Message

Jorge estévez

Friday 08 October 2010 1:01:40 pm

Hello,

 

I am making a website where users can insert several categorized products in different country-locations, some of the products are available and some not (they use two different classes)

 

I need to develop a search template where users can

  1. Select a single checkbox that once checked means “Available products” OR “Not available products” (this defines which class to search for)
  2. several checkboxes (they define which category of products the user is interested in)
  3. and several checkboxes (they define which countru-locations the user is interested in)

There are two classes of products defined, let’s call them

  • Available
  • Not Available

The fetch should be able to

  1. Know which type of product to fetch (available or not)
  2. Then make the fetch only for those whose category attribute XX (object relation) contains the selected ones in the category checkboxes AND only those whose locations attribute YY (object relation) contains the selected ones in the location checkboxes.

I have been studying the advancedsearch.tpl but I am short of information on how to involve checkboxes in a more complex situation.

 

My goal is to have something similar to http://cu.acciontrabajo.com/ displaying a form which a has “selecting Sector”, “selecting Place” and then shows all items that complies the selection with the difference that I also have to know which of the two classes I have to search for…

 

This is kind of confusing for me to explain in English, Hope someone understood…

 

Any hints, maybe someone has done such a search,

 

thanks

I need to stick for other reasons to the conventional search and not using ezfind

Diseño Web Cuba
Web Design Cuba
www.elfosdesign.com

gilles guirand

Saturday 09 October 2010 2:07:35 am

Hi Jorge,

It could help to see your content tree / content classes and datatypes you use.

--
Gilles Guirand
eZ Community Board Member
http://twitter.com/gandbox
http://www.gandbox.fr

Jorge estévez

Saturday 09 October 2010 6:51:24 am

Thanks

My content tree is simple…

There is a “folder” where all products are located, the “Available” and “No Available” ones, the folder´s name is “Poducts”.

“Available Class product” has the following attributes: (This description will only have the important attributes used for the search, I will try to translate because the site is in spanish)

---------------------------------------------------------

Available class ( class ID "available" )

---------------------------------------------------------

Attributes for the product category

Tipología del producto que se oferta [Relación de objeto] (id:468)

Nombre:

Tipología del producto que se oferta

Identificador:

tipologiaproducto

Categoría:

Predeterminado (Content)

Descripción:

Parámetros:

No es requerido

Es buscable (is searchable)

No recoge información

La traducción está activada

Metodo de selección:

Lista desplegable

Elemento de selección predeterminado:

Nombre Tipo Sección

Folder Tipologías de producto Folder Standard

Permitir correspondencia borrosa:

---------------------------------------------------------

Attribute for the country location

---------------------------------------------------------

Para trabajar en las provincias [Relaciones de objetos] (id:480)

Nombre:

Para trabajar en las provincias

Identificador:

provinciasatrabajar

Categoría:

Predeterminado (Content)

Descripción:

Parámetros:

No es requerido

Es buscable

No recoge información

La traducción está activada

Metodo de selección

Listas de multiselección

Tipo:

Sólo objetos existentes

Clases permitidas: (allowed clases!!)

* provinciaparatrabajar

Clase del objeto

(none)

Ubicación predeterminada:

Los objetos nuevos no se colocarán en el árbol de contenido.

---------------------------------------------------------------------------------------------------------

As for the “Not Available product class” ( class ID "notavailable" )

---------------------------------------------------------

Attribute for the product category

---------------------------------------------------------

Seleccione a que tipologia de producto se asocia [Relaciones de objetos] (id:486)

Nombre:

Seleccione a que tipologia de producto se asocia

Identificador:

tipologiadel producto

Categoría:

Predeterminado (Content)

Descripción:

Parámetros:

No es requerido

Es buscable

No recoge información

La traducción está activada

Metodo de selección

Lista con botones radio (radio button list)

Tipo:

Sólo objetos existentes

Clases permitidas: (allowed classes)

 

  • tipologiadetrabajo

 

Clase del objeto

(none)

Ubicación predeterminada:

Los objetos nuevos no se colocarán en el árbol de contenido.

---------------------------------------------------------

Attribute for the country location

---------------------------------------------------------

Para trabajar en las provincias [Relaciones de objetos] (id:480)

Nombre:

Para trabajar en las provincias

Identificador:

provinciasatrabajar

Categoría:

Predeterminado (Content)

Descripción:

Parámetros:

No es requerido

Es buscable

No recoge información

La traducción está activada

Metodo de selección

Listas de multiselección

Tipo:

Sólo objetos existentes

Clases permitidas: (allowed clases!!)

* provinciaparatrabajar

Clase del objeto

(none)

Ubicación predeterminada:

Los objetos nuevos no se colocarán en el árbol de contenido.

------------------------------------------------------------------------------------------------------------------

Form code upt to now:

<code>

<form action="/lapincha/index.php/esl/content/advancedsearch" method="get">

<li><input type=checkbox value="Available"> Pinar del Río</li>

<li><input type=checkbox value="Not Available">Ciudad de La Habana</li>

<h2>1. Seleccione Tipologia<font size=1><label>

<input class="input" value="y" onclick="alert1('1','buscar','sector');" type="radio">Todos</label><label>

<input class="input" value="n" onclick="alert1('0','buscar','sector');" type="radio">Ninguno</label></font></h2>

<div class="searchbox">

<ul>

<li><input value="Office"><a href="/lapincha/index.php/esl/Busca/office">Office</a></li>

<li><input value="Building"><a href="/lapincha/index.php/esl/Busca/building">Building</a></li>

<li><input value="Publicity"><a href="/lapincha/index.php/esl/Busca/publicity">Publicity</a></li>

</ul>

</div>

<div class=clear></div>

<h2><div style="float:left">2. Seleccione lugar</div><div style="float:left"><font size=1><label>

<input class="input" value="y" onclick="alert1('1','buscar','province');" type="radio">Todos</label><label>

<input class="input" name="all2" value="n" onclick="alert1('0','buscar','province');" type="radio">Ninguno</label></font></div><div class=clear></div></h2>

<br />

<div class="searchbox">

<ul>

<li><input type=checkbox value="Pinar del Río"><a href="/lapincha/index.php/esl/Busca/Provincia-a-trabajar/Pinar-del-Rio">Pinar del Río</a></li>

<li><input type=checkbox value="Ciudad de La Habana"><a href="/lapincha/index.php/esl/Busca/Provincia-a-trabajar/Ciudad-de-La-Habana">Ciudad de La Habana</a></li>

<li><input type=checkbox value="Mayabeque"><a href="/lapincha/index.php/esl/Busca/Provincia-a-trabajar/Mayabeque">Mayabeque</a></li>

<li>

</ul>

</div>

<div class=clear></div>

<div class="clear"></div><!--end of search box links -->

<div class="clear"></div>

</div>

<input class="button" name="SearchButton" value="Buscar" />

</form>

</code>

The procedure I need:

User selects Available products or Not Available (Class ID "available" / "notavailable")

Folder to search for nodeID 340

Then selects type of product

 

  • Office

 

  • Building

 

  • Publicity

 

Then the location

 

  • Pinar del Río

 

  • Ciudad de La Habana

 

  • Mayabeque

 

And then clicks the search button

So the search should search at the FOLDER for the RIGHT objects depending of the CLASS value upon selection, that matches the selection values of “type of products” (could be one or several or all) with its corresponding type of product object relation attribute of the class (and see if at least one of the selection matches one of the selections of the object) and the same goes with location… kind of hard to explain…. Anyway the form just could help understand the issue.

thanks again!

Diseño Web Cuba
Web Design Cuba
www.elfosdesign.com

gilles guirand

Sunday 10 October 2010 6:37:45 am

Ok, there a lot of think to say / explain about your issue.

Your content classes :

Maybe, you should use the same classe for "available" and "non available" products (using a specific attribute to distinct your products type, like a checkbox, object relation, option...). Maybe i miss a project parameter ?

Make choice beetween eZ Find or a classic eZ Fetching :

Why do you need eZ Find ? (do you need relevancy ? full text search engine ?). Correct me if i'm wrong, but you try to :

  • Browse your categories, countries, and display them inside a select box (filter selection)
  • Browse your products depending of these filters, and no more ?

Waiting to your answer, before explain more :)

--
Gilles Guirand
eZ Community Board Member
http://twitter.com/gandbox
http://www.gandbox.fr

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.