• ztig

    (@ztig)


    Hi.

    I setting up a private shop for about twenty customers from five different companies. Each user has been assigned with a custom meta field corresponding to their respective companies.

    What I want to accomplish is that each product only can be bought one time from each company.

    I′ve been able to use woocommerce_customer_bought_product to disable the product from been repeat bought from the same user but thats not what I need, I want the product to bee disabled for everyone that has the same “Company name” value as the one who bought it. Is there any way to extend this functionality to check for custom meta instead of e-mail address, or am I approaching this from the wrong angle?

    Using product variations is not an option, since the products are being collected from an open form in the front end, which does not support variations, only plain meta fields.

    Another option would be to echo the company name of whoever has bought the product into the product loop to inform and disencourage purchasing from the collegues. What would be the right approach to achieve this?

    https://www.ads-software.com/plugins/woocommerce/

  • The topic ‘Make purchased product unpurchasable for customers with same custom meta’ is closed to new replies.