Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi, here is what I used at the very top:

    <?php
    if( !is_user_logged_in() ) {
    	wp_redirect(get_permalink(24));
    }
    else{

    [the rest of the original .php code….]

    gxb101

    (@gxb101)

    This issues has plagued me for the last 2 days and I am happy to report I found a workaround. 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 must do is edit the archive-product.php file (found in the woocommerce root dir) and add some custom php code to the very top such as this:

    if( !is_user_logged_in() ) {
    	wp_redirect(some-page-on-your-site);
    }
    else{
    [the remaining original php code follows here...]

    What this will do is check to see if the user is logged in and redirect them to some other page is they aren’t, else they will see the page as intended. The trick is to redirect them to some other page which makes them either login or register for site access.

    Problem solved.

    Thread Starter gxb101

    (@gxb101)

    I deactivated the plug-ins and all was the same. When I switched to the default theme, everything looked fine. Obviously there is something in the theme causing the disturbance. Any thoughts on next steps? Thx

    Thread Starter gxb101

    (@gxb101)

    No, haven’t done either of those things for the reason being that the files and database tables are literal copies of a site which works fine on another server. Am I incorrect in assuming that the copies should work in exactly the same manner?

Viewing 4 replies - 1 through 4 (of 4 total)