Hi @tonygao,
Thank you for reaching out.
I understand you’d like to enable product review on a specific product using a PHP snippet.
To clarify, helping out with custom coding of this nature is outside the scope of support here, although I would recommend the following:
- Running the exact question you’re asking, along with the code provided, through an AI platform like ChatGPT for recommendations/changes to your code;
- Checking whether there are existing plugins in the WordPress plugin repository that might be doing that already.
- Joining our WooCommerce Slack community (it does have a developer channel where you can ask coding questions): https://woo.com/community-slack/
Hope it helps!