I have a new table (RuleCalendar). This table is associated to the products (Woocommerce) and I want to show the data in the content-product from the new table. The client will select some information and I need to calculate in the server side.
I don’t know if it’s better to create a new endpoint in the WP API Rest or connect with Ajax fetch() and make a direct SQL query in php with $wpdb. Can you please advise me in terms of security and efficiency?
Thanks you in advance.
I tried fetch() calls but it didn’t work well.
Damuoza is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.