On my custom post(type Product) page CRED post form creates new post(type Order) .
How to get current Product data into form and post it?
For example:
We are on my Sample Product page and composing order(filling CRED form).
Form fields like customer name, mail etc are there.
Wish to add automatically product name and price to order.
Can You give me a sample piece of code to populate my product SKU(custom field slug is 'prod-sku') in to form field 'tel-sku'.
Here is the row in my order form:
This hook can be used to fire a custom function that executes when the form's data (order) has been saved to the database.
In your function, you can check if the checkbox has been checked or not. And if checked, you can get the required custom field values from the product and save them in the 'extras' field of the order itself.