Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

User specific categories


Beertje

Recommended Posts

What would be the best way to create product categories that are only shown to 'flagged' users? Of course, I have added a tinyint(1) to the customers_info table. Now I need to get categories.php to only show certain categories when that flag is '1'. Also, I'd want products from those categories to only show up as new items and in searches etc. when that flag is set.

 

Now, I'm very (very, very....) new to PHP and MySQL. I've been scanning categories.php and advanced_search_result.php but I can't seem to find the right place to inject the ci.flag = '1'. Will that even work? I've been looking for a contribution that does this, but all I came across was password protected categories, which isn't quite what I'm looking for.

 

Any help would be largely appreciated!

Link to comment
Share on other sites

Suspect you need to start in \includes\boxes\categories.php

 

For more info on sql try www.w3schools.com

 

To prevent products in permitted categories from showing via the searches is more difficult. What happens in nested categories if the one 2 levels up is not ok but the one it is in is OK?

 

Enjoy

 

G

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

I considered that, too! So, the categories that would be listed to flagged users only, are all top-level categories without sub-categories. I think this would make it easier, and still serves my purpose. Well, it looks like a nice small project to sink my teeth into :D

 

Suspect you need to start in \includes\boxes\categories.php

 

For more info on sql try www.w3schools.com

 

To prevent products in permitted categories from showing via the searches is more difficult. What happens in nested categories if the one 2 levels up is not ok but the one it is in is OK?

 

Enjoy

 

G

Link to comment
Share on other sites

So every time you select a product you have to walk up the category tree to see if it can be displayed. OK for a one or 2 level shop but if it goes deeper.

 

Sounds like fun.

 

Maybe consider putting it on the product?

 

G

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

Well, it's only for two or three toplevel categories with no sub-categories in them. Will that really be that hard to implement? Tbh, I have no idea... Isn't adding certain restrictions to the queries in the applicable spots enough to make it happen?

 

 

 

So every time you select a product you have to walk up the category tree to see if it can be displayed. OK for a one or 2 level shop but if it goes deeper.

 

Sounds like fun.

 

Maybe consider putting it on the product?

 

G

Link to comment
Share on other sites

Start with the categories box and when you have that working move on to sorting out the searches

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

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