Toolset forms can interact with Products of WooCommerce in this way:
- when a post or user is created or edited, a Product (one) can be bound to the action so that when the user submit the form, the user needs to purchase that product bound to it.
https://toolset.com/documentation/user-guides/using-cred-commerce-to-add-payments-to-forms/
So, you could let the user (guest) EDIT a actual Obituary.
The user would not see any fields in the Form (remove them) but only the Submit Button and a select Field that you set up with below instructions:
https://toolset.com/documentation/user-guides/using-cred-commerce-to-add-payments-to-forms/#2-1-product-to-buy
The user will choose the product to buy from the field, submit the form, and pay the product.
Now you will receive a notification (can be added to the Form) that tells you someone just edited post xy (the obituary) and purchased product xy (flower)
Fromt there you should be able to make sure the correct flowers are sent to the right obituary.
However, this is a bit cumbersome in the approach, as you maybe want to send many flowers AT ONCE to the same obituary and that wouldn't be possible in this case (unless you offer some flower packages, maybe, bundled in one product).
Now, a better approach could be to not use the Forms Commerce logic above, but only WooCommerce logic.
WooCommerce has natively already what you need:
the delivery / shipping address.
So, if you could update that with the data you have in your Obituary posts, then that would do the trick, right?
You can:
lien caché
Basically you will use that code to update the shipping address of the order by WooCommerce.
The code sample there does that when the user saves his/her address on checkout:
woocommerce_customer_save_address
It then updates _billing_ data in the sample code, but WooCommerce APU should as well allow to do this when the order is completed and allow to update the shipping data.
https://stackoverflow.com/questions/45967123/updating-client-woocommerce-shipping-address-before-checkout-page