NO BUG: Condition: Product purchased by user doesn't work

Browser: Chrome 132.0.6834.160
OS: Windows

Hi bricks team,

I tried to use the Product purchased by user condition for the first time, but it doesn’t work at all. I also tried to find the reason but I didn’t succeed…

Hi Hosein,
Thanks for your report!

Without knowing what you have tried where it is difficult to say what you want to report as a bug :slight_smile: However, I think you have a different idea of what it does. Unfortunately, we haven’t documented this anywhere yet.

We use the wc_customer_bought_product core function, which does the following:

“Checks if a customer has bought an item. The check can be done by email or user ID or both.”
Useful core functions - Woo Developer Docs

In other words, it checks whether you have purchased a product as a logged-in user to show you other relevant products or simply a note that you have already purchased it.

Best regards,
timmse

Hi timmse,

Yes, I know how this works. But for testing I tried to display a button or any other element in the query loop and then set this condition on it. Then I did some test purchases but it doesn’t recognize as a purchased product for the current user.

Could this be affected by HPOS in WooCommerce?

Have your orders been completed (status)?

1 Like

Hi timmse,

Yes, I just made another test purchase, changed its status to completed, but it still didn’t work.

Strange, it works perfectly for me.
You already know the game: can you send us access data and a link to this thread? Thank you!

1 Like

Hi timmse,

I just emailed the access data.

Hi again,

Just to update, this is a problem on the WooCommerce side and not a problem on the bricks side.

Any update on this bcs it’s not working for me as well ):

Hi @yasir,

This is actually a problem with WooCommerce where, under certain circumstances, data from deleted orders remains.

You should delete the transient data using the wp dashboard > woocommerce > Status > Tools options, which I hope will solve your problem. It worked for me. If your website is live, I suggest you take a backup first.

Hi, @HOSEIN

Thanks for your reply. Still same for me ): i cleared both WooCommerce transients + Expired transients also i’m not using any other woocommerce related plugin not even using any cache plugin for now.

1 Like

After encountering this problem, did you enable HPOS in WooCommerce settings?

If the answer is yes, clear this option as well. Also try Clear analytics cache. If you still don’t succeed, contact WooCommerce support and describe your problem in detail.

Also, please update here if you find a definitive solution so I can mark it as a solution for people who encounter this issue later.

Thank you

Still same ): I will reach wc support if I found the solution I’ll definitely inform here.

1 Like