Ask your WordPress questions! Pay money and get answers fast! (more info)

Help with a custom chained filter

  • SOLVED

Hi, lads.

I implemented some functionality in one of my clients sites trough a plugin (Category Ajax Chain Select). It's working ok, but I need to add it some more functionality to make it work in some other way.

This plugin helps me filtering results trough a select opction search in a custom taxonomy.

[[LINK href="http://www.sitiosguau.com/santiveri/puntos-de-venta""]]Here you have the live example[[/LINK]] filtering the custom taxonomy "categorías" in the custom post type "tiendas".
And this is the piece of php I need to use to display it:

<?php chainselect_getcategories( 'categorias', 3, array('Selecciona un estado', 'Selecciona una ciudad', 'Selecciona una colonia'), array('Estado','Ciudad', 'Colonia'), 'Buscar', '') ?>

And here's a short explanation on how to use the plugin: [[LINK href="http://www.peterjharrison.me/2011/11/category-ajax-chain-select-wordpress-plugin-2/"]]http://www.peterjharrison.me/2011/11/category-ajax-chain-select-wordpress-plugin-2/[[/LINK]]

Now I need to add one specific ID of one more custom category (non hierarchical) called "productos" to add one more filter to the query to search in, besides the all ready selected options, the specific ID of the "tag" or custom non hierarchical category called "productos".

This is because my client wants to limited the search just to the stores with that product (Im using the "productos" custom non hierarchical category to groupe the stores with that product in commun)

I know I'll have to manually change the parameters of the php piece of code to match exactly what I want and exclude the id I don't want to query in... it's not a problem, just want it to function so can accept the custom non hierarchical category "productos" .

Off course I'll fill the "productos" taxonomy by my self (since there are more than 800 post to add this taxonomy) I just want to help make make it function and I'll do the boring work...

I can talk to you live or what ever you need to give you more explanations... I figure it's not that hard, it's just that i'm learning PHP and still don't got the knowledge to do it by myself

It's really urgent!

Thanks

Answers (3)

2012-12-18

Arnav Joy answers:

As i can see currently the first dropdown box is "Estado"

so this drop down box lists the taxonomy terms?

then if i choose any value from the first dropdown box then corresponding posts will show at second drop down box "Ciudad" ?

and what is third dropdown "Colonia"

do you want to add new "productos" taxonomy or "term" to the first dropdown box ?

can you answer my these question by clearly specify them.


alejandro Carrillo comments:

Hi, Arnav.

Yes, you are right in wverything, but i want to and the "products" or the specific id of the product taxonomy in a New dorp down below "Estado" "Ciudad" and "Colonia" wich sleects by default the specific Id of the "products" taxonomy in order to and the last filter to the search

Thanks!

2012-12-18

Gabriel Reguly answers:

Hola Alejandro,

How about this code?

?php chainselect_getcategories( 'categorias', 4, array('Selecciona un estado', 'Selecciona una ciudad', 'Selecciona una colonia', 'Selecciona un producto'), array('Estado','Ciudad', 'Colonia', 'Producto'), 'Buscar', '') ?>

Saludos,
Gabriel


alejandro Carrillo comments:

Hola, Gabriel.

Gracias, pero no, no funcionó. Si sale el nuevo dropdown con productos, pero no funciona por que no está especificado en el código, <strong>'categorias', 4, array</strong> sólo dice categoría y no productos. Ya intente agregarle ahí productos pero no sirve.

Esto es lo que sale con el pedazo de código que me pasaste: (te lo anexo)

Gracias