Jump to content

Recommended Posts

I am modifying some pages in CRE Loaded.

 

allprods.php list all currently active products and I added a manufacturers column that displays who makes that product.

 

I want to allow shoppers to filter the product list so that it shows only products from a particular manufacturer.

 

I have gone through several scenarios in my mind, but nothing I've thought of seems simple and bullet proof.

 

One of the issues is that the all products query includes all manufacturers.  If I were to put a variable in the query to select only a particular manufacturer, how would I code it so it does not interfere with the all products query?

 

Would logic based upon the value of a form action work?  If form action exists, someone wants to filter.  If not form action or form action = all, then they want the whole list.

 

Seems like filtering a list is pretty common and there should be an easy solution.

 

Suggestions?

 

TIA

Link to comment
https://forums.phpfreaks.com/topic/70348-filter-results-of-query/
Share on other sites

Would logic based upon the value of a form action work?  If form action exists, someone wants to filter.  If not form action or form action = all, then they want the whole list.

 

Yeah, something like that. You would then have two seperate queries. One sorted selecting only a certain manufacturer, the other as per normal. Can't really help much more without seeing some code.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.