Okay
  Public Ticket #2644889
Restriction products
Closed

Comments

  • Luke started the conversation

    Hello

    I'm using your B2BKing well but I have a question.
    There are 6 products and I want to restrict guests and subscribers(or B2C users) can see only 3 products. Users by being created subaccount can see whole products. 

    1. Guests and B2C users(just registered users by themselves) can see only 3 products(restricted to see)
    2. Customers (subaccount users were created by the account holder) can whole products(no restriction)

    3. Even the setting of the 'New User Default Role' is 'Subscriber', the new user's role is 'Customer' always. I have to set the default role as 'Subscriber'.


    Can you let me know how to do it, please?

  •  2,131
    WebWizards replied

    Hello Luke,

    Thank you for purchasing our plugin, And apologies for the late reply, we have been working reduced hours during the Holiday period - as we are starting work again normally, we should be much more responsive going forward.


    1. To make guests and B2C users see only 3 products, you can simply set manual visibility for each of your products: invisible or visible for b2c/guests.

    You can follow the instructions here: https://woocommerce-b2b-plugin.com/docs/faq-product-visibility-is-not-working-how-to-set-up-product-visibility/ .

    For your 3 products that are invisible you would go to the product page and scroll down to manual visibility, and set the items as invisible for guests/B2C like this:

    7611801896.png


    2.

    Subaccounts inherit the visibility of their parent account. So if the main account can see X items, subaccount sees X as well.

    If you need subaccounts to have no restriction, the main account must have no restriction as well. You can create a B2B Group for the accounts that have no restriction and add your customers with subaccounts in that group.


    3.

    Try to add this Code Snippet to your functions.php or to any code snippet plugin:

    /**
     * Replace 'customer' role (WooCommerce use by default) with your own one.
    **/
    add_filter('woocommerce_new_customer_data', 'wc_assign_custom_role', 10, 1);
    function wc_assign_custom_role($args) {
      $args['role'] = 'subscriber';
      
      return $args;
    }
    

    It should set the default role to subscriber.


    4.

    If you run into issues with the configuration, you can also give us a temporary login to your site and we are happy to try and configure things for you. For that, please tell us which products you need hidden/visible.



    Wishing you a Happy and Prosperous New Year ahead,

    Kind Regards,

    Stefan



  • Luke replied

    Hello Stefan,
    Thank you for your amazing answers.
    I solved most of all but one still persists.

    Can I make another B2C group?
    Now, I can make B2B groups but can't find an option to make another B2C group. (just 'B2C')
    If this feature is, I think your B2BKing can make a more flexible and amazing environment.
    Because I have to set up even B2C customers' levels.

    I hope you reply,
    Thank you so much in advance and happy new year!

  •  2,131
    WebWizards replied

    Hi Luke,

    Glad I could help,


    If you need to set things up differently for some B2C customers, I would advise you to create a "B2B Group" for them.


    In the first plugin versions, "B2B Groups" were simply called "Groups" - we renamed them to improve the interface/plugin ease of use. The plugin code doesn't understand that a group is B2B or B2C. It only understands that a group should be treated differently than regular users. 


    Or is there any reason why you could not place these customers in a B2B group?


    Kind Regards,

    Stefan



  • Luke replied

    Hello Stefan,
    Thank you for your support.

    This is why I need to make another B2C group or another idea for my structure.
    I attached an image, so please let me know if you have another idea for it.

    Thank you always and have a nice day!

  •  2,131
    WebWizards replied

    Hello Luke,

    And my apologies for the delayed reply with this,

    I think your screenshot is mostly correct.


    My thoughts are that the best way to handle this is:

    1. You have a group named AGENTS which can see all items. Their subaccounts will also be able to see all items. These users can create subaccounts and send them to end customers.

    2. All other users are in the B2C group - that means that also they can't access b2b features such as subaccounts - users in the B2C group can't create subaccounts. When you check "Enable Subaccounts" that does not apply to B2C users.

    So I think you only need these 2 groups, B2C (default group), and AGENTS.


    Kind Regards,

    Stefan



  • Luke replied

    Hello Stefan,

    Thank you for your help.

    But, customers who signed up by themselves and subaccounts have the same B2C group.
    (I need 3 tier for users - Agent, Subaccount by the Agent, and the Customer)
    So If I create other B2C groups, I can build a more variable and flexible shop for wholesalers, resellers, and guests by setting 'Registration Roles' and 'Group'.


    Your supports help me on many sides besides B2BKing. 👍

  •  2,131
    WebWizards replied

    Hi Luke,

    I understand some more options for extra B2C groups might be helpful, but it's not currently possible with the plugin's design.

    I am trying to think of alternative solutions for how you can achieve your desired setup.


    Just to clarify this, Subaccount users are considered the same as parent accounts (in this case the plugin would give them the same visibility options as it gives agents).