• Resolved dinhtrong

    (@dinhtrong)


    I want to display products for each user role. For example:
    – silver users: can see regular products + products for silver users
    – gold users : can see only silver users + products for gold users

    Thanks,

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Andrew Lima

    (@andrewza)

    Hi @dinhtrong

    Thank you for reaching out to Paid Memberships Pro.

    Can you please tell me what products you are referring to? Is this through WooCommerce or another e-commerce plugin?

    If you’re using WooCommerce here is a custom code snippet that you may use to filter your store based on the user’s membership level – https://gist.github.com/andrewlimaza/d03ecc4441385fa40debdc73ceb2d569

    Please note that our support doesn’t cover custom code recipes like the one I shared, as it may be used for a starting point that a developer may be able to work from to customize your site further.

    I hope this helps get you started.

    Thread Starter dinhtrong

    (@dinhtrong)

    hi @andrewza ,

    thank you.

    I using WooCommerce, my idea is quite simple, I just want each product to be visible for each user role.
    For example:
    T shirt, only visible when the silver user is logged in.
    Hat is only visible to gold users
    can I do this without custom code?

    Thanks

    Plugin Support Jarryd Long

    (@jarryd-long)

    Hi @dinhtrong

    This wouldn’t be possible without custom code. Making use of the code recipe @andrewza shared should get you started though – you would need to adjust parts of the code that hooks into the woocommerce_product_query filter to reference a product ID instead of product categories and work from there.

    Thread Starter dinhtrong

    (@dinhtrong)

    Thank you. great support. I will do it the way you mentioned

    thanks,

    Plugin Support Jarryd Long

    (@jarryd-long)

    Only a pleasure. Feel free to reach out if there’s anything else we can assist with.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Display products for each user role’ is closed to new replies.