Hi. My client's website uses Woocommerce to sell and quote machines. We've set up two CPTs using Types: Companies and Contacts. Machines (woo products) use the product taxonomy; we've added the Woo product taxonomy to Companies and Contacts so we know what Machine categories each one is associated with.
We've set up relationships so that the Parent is the Machine. Its child is Company (Machines are 'owned' by a Company) and Contacts are children of Companies.
I have a CRED form where we add a new Company. At the bottom of that form (built with the auto-generate function and tweaked a little in terms of labels), there is a drop down that lets the admin select the associated Machine. Here's my question: I would like to offer the ability to select more than one Machine. I think a multi-select would be too unwieldy so I'd like the ability to have a + as an option to add more Machines.
Once this form is done, I want to be able to edit an existing company and add more Machines as their children. As a side note, I will build a CRED form to add a Machine (adding a new product to WooCommerce) along with Post Fields which will necessarily give the option to assign a Company to that Machine.
Can you guide me on how to do add the option to add additional Machines to a new Company (that I'll use on the edit a Company form too)?
The CRED form is here: hidden link
here is the code to add the machine to the company:
<div class="cred-group cred-group-parents">
<div class="cred-field cred-field-_wpcf_belongs_product_id">
<label class="cred-label">
Select the Machine associated with this Company. Type any part of the Machine title to search.
</label>
[cred_field field='_wpcf_belongs_product_id' value='']
</div>
Thank you.