Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Advanced Question


karozans

Recommended Posts

Posted

Hi all, I have a question for the "Programmer Gods" of osCommerce. I am a noob at php and mysql so I am not sure how to go about this.

 

I work at a company that manufactures parts that we sell to everyone, we also manufacture other parts exclusively for many other different companies.

 

I would like to have customer ABC create his/her account and automatically have access to ONLY the parts that my company makes for everyone. (this part is already done by osCommerce and works great).

 

If customer ABC has my company manufacture a patented part I would like be able to show that specific part to that customer only. So that the customer can see all of my companys parts and all of ABC customers parts too.

 

Of course ABC cannot see XYZ parts or pricing and vice versa.

 

So my question is...

 

What is the most elegant way to do this?

 

I kinda have some ideas but I am not sure what the programming guru's would do.

 

Should I create a new dbase table?

How should I modify the select * from * where statements so that only the correct customers parts are shown?

 

If someone could point me in the right direction that would be awesome.

 

thanks

Posted

Very basic suggestion from the limited info given (and my limited time).

 

But perhaps create a field in "customers" called patented_id default NULL

 

then where the query exists as you suggested

 

SELECT * FROM * WHERE X

 

Perhaps you could add ($result being the array)..

 

if ($result['patented_id'])
$query = "SELECT * FROM <table> WHERE X AND patented_id = $result['patented_id'] ";
else $query = "SELECT * FROM <table> WHERE X";

Archived

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

×
×
  • Create New...