Here are what I found, it seems that you have changed a lots in your website
I have done below modification in your website:
1) Put the Toolset form "Booking Form" in layout
hidden link
It is required to use Toolset form to trigger the action hook "cred_commerce_after_order_completed"
2) Edit the post field group "order group":
hidden link
Add the existed field "adult-number" into the field group, you can add more other existed fields by this:
- click "Add New Field" button-> click "Choose from previously created fields" button
Those fields should be same as your form "Booking Form"
then you will be able to see the fields when you edit single "Order" post
3) Modify the PHP codes in your theme file "functions.php", from line 202 to:
add_action('cred_commerce_after_order_completed','add_meta_to_order', 999, 1);
function add_meta_to_order($data)
{
$cred_form_id = $data['extra_data'][0]['cred_form_id'];
if ($cred_form_id == 24662) { // replace 24662 with your Toolset form ID
$post_id = $data['extra_data'][0]['cred_post_id']; //post ID
$order_id = $data['transaction_id']; // order ID
// get meta from post
$adult_num = get_post_meta($post_id, 'wpcf-adult-number', true);
// save meta into order
update_post_meta($order_id, 'wpcf-adult-number', $adult_num );
}
}
You can add more fields in the PHP codes with get_post_meta( $post_id ... ) + update_post_meta ($order_id ...)
4) Test it in front-end:
hidden link
There are two forms in it, you should use the second one, which is the Toolset form "Booking Form"
- Fill the form, submit
- Complete the payment,
PS: it seems the calculation does not work due to your recent change, if you need more assistance for it, new ticket please.
5) Dashbaord-> Products-> Orders
hidden link
find the new order post, enable the checkbox before it, in the select "Bulk Actions", choose option "Change status to completed", click "Apply" button
6) Edit the new order post, you should be able to see the "adult-number" value is changed to be same as the new "my-order" post
For your reference, and in your website, there are lots of errors, for example:
hidden link
http://www.tripdoggy.com didn’t send any data.
ERR_EMPTY_RESPONSE
It is hard to debug in it. Hope it is clear