You are here:  » Linked drop down lists below search bar


Linked drop down lists below search bar

Submitted by Selector84 on Mon, 2017-01-02 12:32 in

Hi David,

Happy new year.

Below the main search bar is it possible to replace:

Search or browse by: <a href='%MERCHANTBASEHREF%'>merchant</a>, <a href='%CATEGORYBASEHREF%'>category</a> or <a href='%BRANDBASEHREF%'>brand</a>

With a set of linked drop down lists so if merchant was selected the other drop down lists would update?

At the moment the user has to click on either merchant, category or brand to view a drop down list as shown here as an example {link saved}

it would be good if the above is achievable as it saves clicking around pages to do an action that could be condensed.

Many thanks,
Sean

Submitted by support on Tue, 2017-01-03 11:20

Hello Sean,

If your site is niche, one option in place of Featured Products would be to show search results for "bw:" (which returns all products) on your /shopping/ page. That way, and by including the Search Filters widget html above the results you would have drop downs containing all merchants, categories and brands.

To do this, if you edit the plugin file pto.php and look for the following code at line 498:

  $html .= pto_featured("");

...and REPLACE with:

  $pto_q = "bw:";
  pto_wp();
  $html .= pto_search_filters_html()
  $html .= pto_search();

To remove the "Search or browse by..." text, simply delete as required from the Main / Search Form template (wp-admin > Settings > PriceTapestry.org). Also, if you wanted to make the drop-downs auto-submit, simply edit the Main / Search Filters Widget template and add an onClick attribute to each of the opening <select ...> elements as follows;

onClick='JavaScript:this.form.submit();'

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by Selector84 on Tue, 2017-01-03 23:47

Hi David,

Thanks for the quick reply.

Was actually after something like this example > {link saved}

I'v played around with http://www.pricetapestry.com/node/5930, but would need to port it over to the PT WP plugin somehow so it works direct within the PT plugin.

Heres the code I would need to transfer over to pto_search.php some how.

{code saved}

The reset button is a bit buggy as you need to manually return values to trigger the onChange='JavaScript:formLoad();' assuming this is the issue.

Thanks,
Sean

Submitted by support on Wed, 2017-01-04 10:14

Hello Sean,

Bear with me and I'll test out a WordPress port of the dynamic form example. Does, or can, your WordPress template include the jQuery library?

Cheers,
David.
--
PriceTapestry.com

Submitted by Selector84 on Wed, 2017-01-04 13:19

Hi David,

Yes the JQuery library is included in the current template,

Regards,
Sean