Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Filter products based on seperate table, help!


ric4star

Recommended Posts

Hi, hopefully a member of the community here will be able to help me out with a tricky osCommerce problem I've got.

 

Background:

 

I have a functional live installation, but my client now wishes to extend functionality by allowing users to browse & search the available products based on an additional criteria.

 

The website sells car parts, and the extra filter will be for users to select either their car make or model, after which only products matching the chosen make/model will be displayed. I will create additional tables in the database linking product ID's to car ID's and so on.

 

Problem:

 

Ideally this will be implemented in the form of a drop down menu. When products are being browsed by category, manufacturer or search results, there should be a drop down menu at the top of each page, which will then pass additional variables in the query string and refresh the page, for example:

 

index.php?osCsid=6568fdfa5aae60fab4927289c621a1fa&manufacturers_id=2&osCsid=6568fdfa5aae60fab4927289c621a1fa&carID=23

 

I'm pretty sure I can add in the drop down myself, but the difficult part is the actual filtering of the products.

 

The simplest solution I've come up with is by for each product that is returned, for example if the user is viewing all items in a cateorgy, e.g. gearsticks, a little line of PHP will execute an additional query to check whether the product ID of the item is listed for this particular car.

 

To put it simply; does anyone know how I can run an additional php line of code for each product brought up in results?

 

Thanks for reading my post. Cheers.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...