Change WordPress user roles and capabilities Forums Restrict or Permit access inside WordPress – how to Restrict access to woocommerce product category not working, how to debug?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #7783
    [email protected]
    Participant

    I’m trying to restrict access for all users for one specific woocommerce category and allow it for one user role.
    https://finecharmingnails.be/product-categorie/this-is-us/this-is-us-voor-professionele/

    Initial setup was allow for specific role (users with vat) and on customer role prohibit the view for that category, but that wasn’t working. So I’ve prohibited the view for All visitors (logged in or not) and I can still access it.

    Is there any way to debug this to figure out why this isn’t working?

    #7784
    Vladimir
    Keymaster

    In order to exclude product from listings, you have to select action “404 HTTP error”. Content view restrictions protects directly only post/page content or full description for the products. It does not prohibit to theme or plugin to show any other product attributes, like price, image, etc. until you select the “404” or “redirect” action.

    Take into account that you can set view restrictions directly for the product category.

    #7785
    [email protected]
    Participant

    Thanks for the reply, i’ve did some more testen, but the only thing i can do is block the product category for logged in users only.

    I’ve tried setting the following on the product category itself, but that doesn’t do anything
    Content View Restricitions
    View Access:
    o Allow View
    x Prohibit View
    For Users:
    x All visitors (logged in or not)
    o Any User Role (logged in only)
    o Selected User Roles
    Action:
    x Return HTTP 404 error
    o Show access error message
    o Show custom access error message

    Next step was to set the following on the vat-user role
    Block: o Selected x Not Selected
    x Return HTTP 404 error o Show access error message
    And select every product category id

    But since the setting on the product category doesn’t work i didn’t get this far 🙂

    Setting up the user role as follow
    Block: x Selected o Not Selected
    x Return HTTP 404 error o Show access error message
    And select a specific product category does return “no products found”

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.