0

I need to check if a customer has purchased a specific digital product in WooCommerce.

The case is this: The customer shall not be able to purchase product "b" if they already have purchased product "a" at an earlier time - product "b" is a part of bigger product in that case "a", do if you own product "a" you have product "b" in it.

If the customer has purchased product "a" earlier, then the purchase button of product "b" is inactive or hidden so they won't be able to purchase.

Thanks.

Cray
  • 5,307
  • 11
  • 70
  • 166
  • You could use [wc_customer_bought_product()](https://woocommerce.github.io/code-reference/namespaces/default.html#function_wc_customer_bought_product) with associated code. However, your question does not meet the guidelines of stack overflow so please read [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) and [Stack Overflow question checklist](https://meta.stackoverflow.com/questions/260648/stack-overflow-question-checklist). After you have read this, you can edit your question. Also take the [tour](https://stackoverflow.com/tour) – 7uc1f3r Aug 28 '20 at 16:30
  • Related: [Disable WooCommerce products for some time if customer has purchased specific product](https://stackoverflow.com/questions/63332161/disable-woocommerce-products-for-some-time-if-customer-has-purchased-specific-pr) – 7uc1f3r Aug 28 '20 at 16:36

0 Answers0