简体   繁体   中英

Price range filter in opencart

I have the filter module installed in Opencart V2 that filters products on a variety of attributes. They are all check boxes.

I want customers to be able to filter products using a price range slider. There are a lot of modules available online, however most are for V1.5.

How would I go about incorporating a range <input> to filter my prices?

I could add a price attribute in filters, however this limits the customer to a variety of check boxes - and I need my pricing to be extremely accurate (it will be displaying over 50,000 products).

Is there a way I can edit the current filter module, and not create a new one?

I have implemented several pricing filters in opencart. The available filters are not free so I decided to make my own. Here is what I did.

  1. I made a custom module (price_filter) and made 3 fields in it. Min price, max price (both dynamic) and status and I downloaded price range html and put it in the tpl .
  2. I enabled it and then on search, i grabbed the url through jquery and integrated my two own parameters (min price and max price) through jquery and reloaded the page.
  3. In the controller, i retrieved those variables, passed to filter_data array and changed the model a little bit too. I added the min_price and max_price conditions in my model.

It was simple if you know how to play with controller and model.

Solved my problem using this extension here: http://www.opencart.com/index.php?route=extension/extension/info&extension_id=23022&filter_search=jquery%20price%20slider&filter_download_id=42&sort=e.price&order=ASC

I am using the default theme, with stylesheet modifications. It wasn't working at first as I had modified the category.tpl file to such an extent that the plugin wasn't working correctly.

Resetting the .tpl file to it's defaults and making new changes, it now works.

You can use opencart flexi product filter extension to solve this problem

https://www.opencart.com/index.php?route=marketplace/extension/info&extension_id=35570&filter_member=TemplateMaza

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM