The WordPress Posts & WooCommerce Products Restrict Access / Scheduler (WPPS) plugin is a powerful tool by which the Site admin can schedule or restrict access to posts, custom posts (like WordPress pages, bbpress posts, or any other 3rd party custom posts ), and product visibility by “date rules” and for user roles.
WooCommerce products can also be set as “Unpurchasable” (visible but cannot be added to the cart).

LIVE DEMO

https://www.codecanyondemo.work/wpps/wp-admin
(Shop admin user role)
user: demo
pass: demo
(Customer role)
user: demo2
pass: demo

HOW IT WORKS

It’s very easy, once installed and activated, the site admin will find a new “Scheduler” menu voice on the main menu by which he can access the Scheduling rules configurator.
With this menu, the shop admin can set up scheduling rules to automatically publish/unpublish posts, custom posts (like WordPress pages, bbpress posts, or any other 3rd party custom posts), and products. He can also simply restrict access to contents
by user roles. In case you are restricting posts/pages by user role, you can also choose to redirect to a page.
NOTE: To restrict access to not logged users you have just to select at least one role in the user role selection section.

SET PRODUCT AS UNPURCHASABLE

Feature not compatible with Measurement Price Calculator
Shop admin, for WooCommerce products, can use the special Unpurchasable option. Enabling this and setting visibility status to Visible the selected product will be visible
but cannot be added to the cart by the customers (or the ones belonging to the roles chosen on the roles restriction option area) due to the “add to cart” button removal.
After and before the Unpurchasable period the shop admin can choose if the product has to be set as Purchasable or Unpublished.

During the Unpurchasable period can be also optionally displayed two different messages on product and shop pages.

Note: Make sure that the theme you are using is correctly using the woocommerce_after_single_product,
woocommerce_loop_add_to_cart_link and woocommerce_single_product_summary actions in the shop and single product
page (as the woocommerce reference templates do) otherwise the plugin cannot hook properly to the theme to remove the add to cart button. All well-designed themes correctly use these actions.
Note: In case the WooCommerce Availability Scheduler plugin is active, the unpurchasable feature won’t work.

SCHEDULING/RESTRICT ACCESS RULES

The site admin can assign to a set of posts/products (directly selecting them or a set of categories) multiple scheduling rule. Each scheduling rule has the following option:

  1. Rule name/id
  2. Item type (WordPress post or WooCommerce product)
  3. Item(s) selection
  4. Category(es) selection
  5. Assignment strategy (the rule can be assigned to the selected items/categories or to all items except the ones selected)
  6. “Children” categories (if a category was selected, that rule can be assigned also to its children)
  7. Scheduling dates (for every scheduled time period is also possible to restrict visibility by user roles)

Scheduling dates

For each scheduling rule, the site admin can create different scheduling dates (configuring day(s), month(s), hour, …) for each of which different statuses (published or unpublished) can be assigned.
Here two examples of what can be done:

Example 1 (WooCommerce Products)

The shop admin would like to make a product(s) to be published every day of the year only between 09:00 to 18:00 and unpublished in the remaining hours and on 25th December.
The Scheduling rules will be configured as follows:

  1. Create a new rule and assign a name/id
  2. Select “WooCommerce product” item type
  3. Select an item(s) and/or category(ies)
  4. Create a new date rule where:
    1. https: Published
    2. User roles: Leave unselected
    3. Start date type: Day of the week
    4. Days of the week: Select all
    5. Months: Select all
    6. Hour: 9
    7. Minute: 0
    8. Invert item(s) HTTPS during unmatched time period: yes
    9. End hour: 17
    10. End minute: 59
  5. Create a new date rule where:
    1. https: Unpublished
    2. User roles: Leave unselected
    3. Start date type: Day of the month
    4. Days of the month: Select 25
    5. Months: Select “December”
    6. Hour: 9
    7. Minute: 0

Example 2 (WordPress Posts)

The site admin would like to make a post available only on the even days of the week and unavailable on the remaining days.
The Scheduling rules will be configured as follows:

  1. Create a new rule and assign a name/id
  2. Select “WordPress post” item type, item(s) and or category
  3. Select an item(s) and/or category(ies)
  4. Create a new date rule where:
    1. https: Published
    2. User roles: Leave unselected
    3. Day date type: Day of the week
    4. Days of the week: Tuesday, Thursday, Saturday
    5. Months: Select all
    6. Hour: 0
    7. Minute: 0
  5. Create a new date rule where:
    1. https: Unpublished
    2. User roles: Leave unselected
    3. Start date type: Day of the week
    4. Days of the week: Monday, Wednesday, Friday, Sunday
    5. Months: Select all
    6. Hour: 0
    7. Minute: 1

Example 3 (Restrict pages access to non-logged users)

The site admin would like to restrict access to some pages for not logged users, for example, the Shop, cart, and checkout pages. Here is how to:

  1. Create a new rule and assign a name/id
  2. Select the “Custom posts” item type and the select “Shop”, “Cart, and “Checkout” pages.
  3. Create a new date rule where:
    1. https: Published
    2. User roles: Select all
    3. Day date type: Day of the week
    4. Days of the week: Select all
    5. Months: Select all
    6. Hour: 0 …