Woocommerce Shop page restrict – UserPro Forums https://forum.userproplugin.com/forums/topic/woocommerce-shop-page-restrict/feed/ Wed, 15 May 2024 21:04:57 +0000 https://bbpress.org/?v=2.6.2 en-US https://forum.userproplugin.com/forums/topic/woocommerce-shop-page-restrict/#post-35083 <![CDATA[Woocommerce Shop page restrict]]> https://forum.userproplugin.com/forums/topic/woocommerce-shop-page-restrict/#post-35083 Sun, 27 Apr 2014 21:03:32 +0000 mcmedia79 Ok, I’ve checked everything for a couple of hours and I can’t restrict access to my woocommerce Shop Page…
I’ve changed the option of my shop page in the poste meta, I’ve deactivated all my plugins except woocommerce & userpro, no results, still seing the products if i’m not logged in.

Anyone having the same issue?

]]>
https://forum.userproplugin.com/forums/topic/woocommerce-shop-page-restrict/#post-35088 <![CDATA[Reply To: Woocommerce Shop page restrict]]> https://forum.userproplugin.com/forums/topic/woocommerce-shop-page-restrict/#post-35088 Mon, 28 Apr 2014 00:02:31 +0000 keyhanjun Hi mcmedia79,

Please read the rules before posting support threads. Your topics may be removed If you do not read this first. We appreciate your cooperation to make this community better.

In particular the Howto on step 1 to verify your purchase.

Should save you some time in getting support. ;)

]]>
https://forum.userproplugin.com/forums/topic/woocommerce-shop-page-restrict/#post-35096 <![CDATA[Reply To: Woocommerce Shop page restrict]]> https://forum.userproplugin.com/forums/topic/woocommerce-shop-page-restrict/#post-35096 Mon, 28 Apr 2014 02:24:01 +0000 mcmedia79 Sorry about that, my purchase key has been added to my account.

Back to my topic,

I’ve inserted this code in woocommerce theme file (archive_products.php) and it worked :

if( !is_user_logged_in() ) {
wp_redirect( home_url(‘/login’) );
}
else{
//rest of the code
}

The only problem is that it’s not redirecting the user to the page they where trying to access before login in.

If you have a better way please inform me.

]]>
https://forum.userproplugin.com/forums/topic/woocommerce-shop-page-restrict/#post-35097 <![CDATA[Reply To: Woocommerce Shop page restrict]]> https://forum.userproplugin.com/forums/topic/woocommerce-shop-page-restrict/#post-35097 Mon, 28 Apr 2014 02:40:18 +0000 keyhanjun Sorry, I was going to provide the same solution for you.

But maybe Ahmed will find a better way. If it’s the case I would be definitely interested too.

]]>
https://forum.userproplugin.com/forums/topic/woocommerce-shop-page-restrict/#post-35129 <![CDATA[Reply To: Woocommerce Shop page restrict]]> https://forum.userproplugin.com/forums/topic/woocommerce-shop-page-restrict/#post-35129 Mon, 28 Apr 2014 10:17:13 +0000 admin Can’t you restrict the page from page settings/editor? Or is it a category/archive?

I introduced new restrict option that works by just checking “a checkbox” in each post/page/product/etc

]]>
https://forum.userproplugin.com/forums/topic/woocommerce-shop-page-restrict/#post-35138 <![CDATA[Reply To: Woocommerce Shop page restrict]]> https://forum.userproplugin.com/forums/topic/woocommerce-shop-page-restrict/#post-35138 Mon, 28 Apr 2014 12:12:59 +0000 mcmedia79 That’s exactly what I did using the new version of userpro.

]]>
https://forum.userproplugin.com/forums/topic/woocommerce-shop-page-restrict/#post-35151 <![CDATA[Reply To: Woocommerce Shop page restrict]]> https://forum.userproplugin.com/forums/topic/woocommerce-shop-page-restrict/#post-35151 Mon, 28 Apr 2014 14:25:00 +0000 admin And it is not working??

]]>
https://forum.userproplugin.com/forums/topic/woocommerce-shop-page-restrict/#post-35197 <![CDATA[Reply To: Woocommerce Shop page restrict]]> https://forum.userproplugin.com/forums/topic/woocommerce-shop-page-restrict/#post-35197 Mon, 28 Apr 2014 21:21:55 +0000 mcmedia79 Nope, the page /shop/ still loads products even if I check the option…

]]>
https://forum.userproplugin.com/forums/topic/woocommerce-shop-page-restrict/#post-35198 <![CDATA[Reply To: Woocommerce Shop page restrict]]> https://forum.userproplugin.com/forums/topic/woocommerce-shop-page-restrict/#post-35198 Mon, 28 Apr 2014 21:29:10 +0000 keyhanjun The problem is that any plugins which can limit access by user level do not work on WooCommerce “Core” pages (ie: the shop page). So, what you did (editing the archive-product.php file (found in the WooCommerce root dir) and add some custom php code to the very top was the right thing to do.

PS: Just a tip: Create the WooCommerce folder under the base folder of your active theme and copy archive-product.php from woocommerce/templates there.

]]>
https://forum.userproplugin.com/forums/topic/woocommerce-shop-page-restrict/#post-35199 <![CDATA[Reply To: Woocommerce Shop page restrict]]> https://forum.userproplugin.com/forums/topic/woocommerce-shop-page-restrict/#post-35199 Mon, 28 Apr 2014 21:52:07 +0000 mcmedia79 Exactly what I did.

Thanks,

]]>