Hi Luo,
I've the last question on my process.
If you remeber I built a booking process from an accommodation custom post type.
I used CRED to set the price of a product, and clicking on the button the product is added to the cart.
Everything works very god.
My problem now is only the last email, when the order is complete. By default woocomeerce send the email as set in the woocommerce email setting.
But I need to send the email to the author of the custom post accommodation.
How can I do?
Hi,
I assume we are talking about a Toolset post form for creating "booking" post, as you can see this "order is complete" email is sent by Woocommerce plugin, so there isn't such a built-in feature within Toolset form plugin, it needs custom codes,
Here are my suggestion, you can try with filter hook "woocommerce_email_recipient_new_order", see similar thread:
https://wordpress.stackexchange.com/questions/312677/cannot-add-additional-receipient-to-woocommerce-emails
More help:
https://docs.woocommerce.com/wc-apidocs/source-class-WC_Email.html#351
Is there any relationship between post type "accommodation" and "booking", if there isn't, I suggest you setup one- post type relationship between them, then in the "order completed" email , you can get the "booking" post ID as this:
https://toolset.com/forums/topic/how-add-the-meta-also-to-the-woocommerce-order/#post-1118111
Then get "accommodation" post ID with function toolset_get_related_post()
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_get_related_post