Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Price ranges instead of Price from... to...


mluce

Recommended Posts

Hello,

 

I installed the quick research infobox contribution but my problem is that I would like another way to choose the prices. Instead of text fiels where you can put the minimum and maximum prices you are looking for, I would like a dropdown menu with options such as "less than 40 ?", "from 40 to 60 ?", "more than 60 ?", etc. Is there any way I can change that ?

 

Thank you very much for your help !

Link to comment
Share on other sites

  • 2 weeks later...

you could create an array with the various price ranges. Then when the form is submitted you could check the id passed from the drop-down list and compare with the product prices in the sql query.

 

If you want something more elegant you have to create scripts on the admin end like the product extra fields for instance.

Link to comment
Share on other sites

For testing purposes you simply hard-code it.

 $list_array = array(
						array('id' => '1',
								 'text' => '10-20'),
						array('id' => '2',
								 'text' => '21-30'),
						array('id' => '3',
								 'text' => '31-40')
					  );

then use the tep_draw_pull_down_menu function to build the drop-down list for you automatically (pass the array as the argument).

 

When the form is submitted you check the pull-down menu's value and you setup the sql query to filter the products accordingly (ie in terms of price like the advanced search results page does when you filter products by price)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...