Beertje Posted November 14, 2009 Share Posted November 14, 2009 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! Quote Link to comment Share on other sites More sharing options...
♥geoffreywalton Posted November 14, 2009 Share Posted November 14, 2009 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 Quote 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 More sharing options...
Beertje Posted November 14, 2009 Author Share Posted November 14, 2009 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 Quote Link to comment Share on other sites More sharing options...
♥geoffreywalton Posted November 14, 2009 Share Posted November 14, 2009 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 Quote 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 More sharing options...
Beertje Posted November 14, 2009 Author Share Posted November 14, 2009 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 Quote Link to comment Share on other sites More sharing options...
♥geoffreywalton Posted November 14, 2009 Share Posted November 14, 2009 Start with the categories box and when you have that working move on to sorting out the searches Quote 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 More sharing options...
Jan Zonjee Posted November 15, 2009 Share Posted November 15, 2009 What would be the best way to create product categories that are only shown to 'flagged' users? Hide products from customer groups for SPPC does this. Might be worthwhile to see how it does that and adapt it to your situation. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.