Zen Cart Logo

hidden product

Views: 2,481

Results 1 to 6 of 6
2 May 2012, 2:25 PM
#1
toodamnbroke avatar

toodamnbroke

New Zenner

Join Date:
Oct 2011
Posts:
36
Plugin Contributions:
0

hidden product

I was reading about hidden products in this post. http://www.zen-cart.com/showthread.php?71523-Creating-A-Hidden-Product I got to reply #8 by Limelites and wanted to try that idea. It was this.
"The simplest way to create a hidden product is to firstly create a unique category, call this HIDDEN CATEGORY. Then disable the category from admin so it's showing the red square.

Then, click into the category and create the products you want to hide. You can still access and purchase these products if you know the URL. No one browsing your store will be able to access these products as they don't know the URL's.

Simple as that really. Works a treat for me."

My question is this, how do you know the URL without being able to nav to that item. So obviously by turning that Category "on" then finding the item and copying the URL, then turning the category "off" works. But is there an easier way to know the URL? I may be potentially adding tons of items to this hidden category and turning the category on/off all the time isn't a great idea. I read about the hidden cat mod, but I wanted to try this first before messing with that.

Thanks
J

2 May 2012, 2:35 PM
#2
jc8125 avatar

jc8125

Zen Follower

Join Date:
Oct 2007
Posts:
143
Plugin Contributions:
0

Re: hidden product

if i'm understanding your question correctly, basically you would just change the product id for each product. For example, if the link to a product in your store is http://www.yourdomain.com/index.php?main_page=product_info&cPath=3&products_id=6867 - you would just substitute the category id and product id (which can be viewed from admin), to create the link for that product. if they're all in the same "hidden category", the cPath will stay the same - but the products_id would change for each.

so if your 2nd product has an id of 6868, the link would be http://www.yourdomain.com/index.php?main_page=product_info&cPath=3&products_id=6868

and so on

3 May 2012, 8:46 AM
#3
rainbows avatar

rainbows

New Zenner

Join Date:
Nov 2005
Location:
Australia
Posts:
26
Plugin Contributions:
0

Re: hidden product

Careful with this. I did this for sales tool items I only wanted my sales consultants to see & not customers, so I sent them a direct link... however even though the category was disabled, and the items were enabled... customers were still able to search and find these items. Sure, they don't show up in the category menu, but I had customers ordering these items as they still came up in searches.

3 May 2012, 10:51 AM
#4
dgent avatar

dgent

Totally Zenned

Join Date:
Nov 2009
Location:
UK
Posts:
1,117
Plugin Contributions:
0

Re: hidden product

rainbows:

Careful with this. I did this for sales tool items I only wanted my sales consultants to see & not customers, so I sent them a direct link... however even though the category was disabled, and the items were enabled... customers were still able to search and find these items. Sure, they don't show up in the category menu, but I had customers ordering these items as they still came up in searches.

With a small line of code you can eliminate any product or category coming up in any searches.

Go into phpmyadmin and into your database and make the id of your hidden product any number over 50,000

Then in modules/pages/advanced_search_result/header.php

Add the line in bold..

$zco_notifier->notify('NOTIFY_SEARCH_FROM_STRING');

$where_str = " WHERE (p.products_status = 1
AND p.products_id < 50000
AND p.products_id = pd.products_id
AND pd.language_id = :languagesID
AND p.products_id = p2c.products_id
AND p2c.categories_id = c.categories_id ";

This will make any product with an ID number higher than 50000 not show up in searches.

Its a bit crude and any new product you add after this will be over 50,000 and not show up, so bare this in mind and change the details. Im sure there's a better way of doing it, or even hiding a specific product number on its own.

3 May 2012, 12:46 PM
#5
jc8125 avatar

jc8125

Zen Follower

Join Date:
Oct 2007
Posts:
143
Plugin Contributions:
0

Re: hidden product

dgent:

With a small line of code you can eliminate any product or category coming up in any searches.

Go into phpmyadmin and into your database and make the id of your hidden product any number over 50,000

Then in modules/pages/advanced_search_result/header.php

Add the line in bold..

$zco_notifier->notify('NOTIFY_SEARCH_FROM_STRING');

$where_str = " WHERE (p.products_status = 1
AND p.products_id < 50000
AND p.products_id = pd.products_id
AND pd.language_id = :languagesID
AND p.products_id = p2c.products_id
AND p2c.categories_id = c.categories_id ";

This will make any product with an ID number higher than 50000 not show up in searches.

Its a bit crude and any new product you add after this will be over 50,000 and not show up, so bare this in mind and change the details. Im sure there's a better way of doing it, or even hiding a specific product number on its own.

one of our websites "hides" a large amount of items for a unique business need.. if you're going to get into the db editing, etc - I might suggest creating a custom field (or better yet, maybe utilizing an unused existing field in the products table) to "flag" these items. Then, instead of messing with product id's and such - you can just edit the sql to exclude any products where "noshow_flag = true" to something like:

$where_str = " WHERE (p.products_status = 1
AND p.noshow_flag = 0
AND p.products_id = pd.products_id
AND pd.language_id = :languagesID
AND p.products_id = p2c.products_id
AND p2c.categories_id = c.categories_id ";

I feel like we had to make some other edits as well - to remove the items from results on the products_all, products_new, etc.. don't want the hidden items showing up there. keep in mind for our solution, it's not a horrible thing if a customer were to "accidentally" find one of these items - but we'd prefer them not to. So, depending on how "critical" your need is to keep these things out of sight, our solution might not be the best for you.

3 May 2012, 12:53 PM
#6
dgent avatar

dgent

Totally Zenned

Join Date:
Nov 2009
Location:
UK
Posts:
1,117
Plugin Contributions:
0

Re: hidden product

My idea would be fine if you were making a new store from scratch. Start your first product from id say '10000' and add products when ever you like, then make any of the hidden products ID below 10000 and modify the code to suit. Then adding more products isnt a problem as the ID numbers will still keep going up, and any products you want to hide, just move to the below 10,000 level.