Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By spirin88 on
Hi guys,
I'm trying to create price filter for taxonomy teasers based on URL.
Example:
/products/standard-cabins.html?price_min=600&price_max=1900
I need a solution like adding/modifying a file in my custom template folder, e.g. for template.php
May be some query request in hook_preprocess_page() function ???
Thanks in advanced
Dmitry
Comments
Are you using views to
Are you using views to produce the page?
Yep, i have page specific
Yep, i have page specific view.
For each product i have created separate page with the various data and one of the custom fields are price field.
This is store in DB as separate table too (field_data_field_product_price).
All my products are connected/mapped with the taxonomy terms and thats works well too, I can see the list of products related to categories or sub categories.
In my custom view (product details page) i have if condition (if teasers) for customising list of products on taxonomy view page, that is solved as well, but how to filter products by price, here im stuck.
Looks like this filtering logic must be done before calculation of taxonomy products collection to have result filtered before the pagination will be applied.
;)
Regards
Anyone, any idea?
Anyone, any idea?
_
I'm not sure I understand the problem. If you're using views and price is a field (which, based on the field name, it seems to be, why not just add it as filter to the view?