Page 1 of 1

WP - private/password protected pages

Posted: Mon Feb 15, 2016 3:42 am
by simonmlewis
Hi there
I need to be able to create product pages, that only customers who know the page is there, can see it.

The whole site will be banned from Google crawlers. But I need to be able to pass the product page URL to a customer, so they can see their private deal I am offering them.

I have tried 'Private', but that's only for the admin who is setting it to private to view it.
I've tried Password Protected, but that doesn't stop it being displayed in the Shop page of Woo Commerce.

Is there a nice simple plugin where you can assign from a dropdown, a product to a registered customer??

Re: WP - private/password protected pages

Posted: Mon Feb 15, 2016 3:50 am
by simonmlewis
Even if I could create a "group", ie, the company who is buying it, and then assign certain products to those certain groups/companies.... that would work. It's not a membership FOR THE SITE, it's specific bundle deals I put together, but I dont' want anyone to find it in the categories and see "Bobs Special Deal".......

Re: WP - private/password protected pages

Posted: Mon Feb 15, 2016 7:41 am
by Celauran
simonmlewis wrote:I've tried Password Protected, but that doesn't stop it being displayed in the Shop page of Woo Commerce.
This seems to me to be the crux of the issue. Does WooCommerce expose any hooks? You could write a small plugin to exclude password protected products from the main shop page.

Re: WP - private/password protected pages

Posted: Mon Feb 15, 2016 8:04 am
by simonmlewis
I wouldn't know how to. It would need to do that for Search, Shop and Category. Oh and in "related products" on category.
There must be a way/plugin that you can hide products, and assign them into to certain accounts?????

Re: WP - private/password protected pages

Posted: Mon Feb 15, 2016 8:09 am
by Celauran
Might be better to ask on dedicated WP boards if you're not keen on writing it yourself. I don't use WordPress much and don't use WooCommerce at all, so am in no position to tell you what plugins do or do not exist.

Re: WP - private/password protected pages

Posted: Mon Feb 15, 2016 9:03 am
by simonmlewis
I have - waiting for replies.
If it were a custom site that I built, it would be a doddle. But I'm surprised I cannot find a plugin that enables you to assign a product to a customer email address. So it's not seen on any normal pages, but if the customer logs in they can maybe see it in an account screen, or just access it via a given URL. Sounds pretty straight forward.

I know there are plugins that assign pages to user roles, but I don't believe you can "create" a user role. IF you could, then perhaps that Role could be a company name.. and hey presto.

Re: WP - private/password protected pages

Posted: Mon Feb 15, 2016 9:06 am
by Celauran
simonmlewis wrote:I know there are plugins that assign pages to user roles, but I don't believe you can "create" a user role.
You most certainly can.
New roles can be introduced or removed using the add_role() and remove_role() functions.
http://codex.wordpress.org/Roles_and_Capabilities

Re: WP - private/password protected pages

Posted: Mon Feb 15, 2016 9:16 am
by simonmlewis
I don't see how to create a role. Let's say "Company A" is a new user role. How do I create that, and assign as "read" ?

Re: WP - private/password protected pages

Posted: Mon Feb 15, 2016 9:24 am
by simonmlewis
Bingo - got it. But then how do I assign a product to be seen only by that user role?

Re: WP - private/password protected pages

Posted: Mon Feb 15, 2016 9:40 am
by simonmlewis
You may not realise it, but you have really helped.

The Groups plugin for Wordpress means I can create a group. Then in the Edit product page, I can assign that product to the user.
What I will do, is create a category for "Members Products" and see if the Account holders products appear in there, dynamically. that would be very cool.