Okay
  Public Ticket #3387613
RFQ buttons and user roles
Closed

Comments

  •  4
    Lukinjo07 started the conversation

    I'm wondering how I can place the RFQ button on any page, like is there a shortcode or do I need to use some custom code, also how can I access the B2BKing user roles because they aren't regular user roles that you can see on the users page, how can I use custom code to restrict pages from those user roles? For example if the user registered but is still not approved they can't access a page, but if they are they can, something like that.

  •  2,285
    WebWizards replied

    Hi there,


    - "how can I access the B2BKing user roles because they aren't regular user roles that you can see on the users page"

    Indeed B2BKing uses its own user groups instead of typical WP roles. We prefer this approach as it avoids plugin conflicts. These groups are configured in the backend, in B2BKing -> Groups. Here you can add, edit or delete groups.

    On each user's profile page, you can select their group here:

    6896992615.png



    - "how can I use custom code to restrict pages from those user roles?"

    To achieve this with B2BKing, the best way would be by using our plugin's Content shortcode. You can read about it here: https://woocommerce-b2b-plugin.com/docs/shortcode-to-restrict-content-to-b2b-b2c-user-groups-specific-users/

    For example if you have a page whose content you want available for B2B users only, you can use:

    [b2bking_content show_to=b2b]Your content here...[/b2bking_content]
    [b2bking_content show_to=b2c,loggedout]Please login as a B2B user to view this...[/b2bking_content]

    Or another example, you can use:

    [b2bking_content show_to=1234]Your content here...[/b2bking_content]
    

    This will make the content visible only to the B2BKing user group with the ID 1234.


    - "how I can place the RFQ button on any page"

    Do you mean to show a RFQ button on a product's page? Currently there's no way to do this. 

    If the product is 'quote-only' (cannot be purchased directly), we can create a rule for this and the button will say 'Add to quote request'. 

    But if the product can also be purchased, then the user would first need to add it to cart (and in the cart choose to either purchase directly or request a quote).



    Kind regards,

    Stefan