Skip Navigation

[Resolved] Setting up a Form to Edit a Many to Many Relationship

This support ticket is created 3 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 18 replies, has 2 voices.

Last updated by aprilB 3 years, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#1764753

Tell us what you are trying to do?
I am using a woocommerce site. I have a custom post type called Showroom. the user will have the ability to create a showroom and add products to their showroom. I am having issues trying to be able to insert the link to the Relationship Form I created.

When I try to add the form to the showroom page so that I can add a link to the form which i added to a template that is not attached to anything, the whole form is added. From reading the documentation I should be getting a wizard that gives me choices about inserting links to create new links.

Is there any documentation that you are following?
https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/
https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/creating-new-connections-between-related-posts/

Is there a similar example that we can see?

What is the link to your site?
hidden link

#1764851

Hello,

It is possible with Toolset Relationship Forms, please follow our document to setup the relationship form:
https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/editing-existing-connections-between-related-posts/

Editing Existing Connections between Related Posts

#1765423
Screen Shot 2020-09-03 at 9.50.52 AM.png
Screen Shot 2020-09-03 at 9.45.33 AM.png

Thank you very much for the reply and the link. I was trying to actually CREATE new connections not edit an existing connection which is what the documentation in your link refers to correct?

https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/editing-existing-connections-between-related-posts/

BUT i went ahead and tried to edit existing connections and I can not seem to get that to work either. I am stuck on step 4 on the above page. The documentation shows a photo of a "Templates for this View" screen that I can not seem to find. I have included a snapshot of the documentation that i am referring to for your reference. I also included a screenshot of what I see on my screen on the template.

Thank you for the help again!

#1765781

Yes, you are right.

If you are going to CREATE relationship between posts, you will need to follow the document you mentioned above:
https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/

If you are going to Edit existing relationship between posts, you will need to follow the document I mentioned above:
https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/editing-existing-connections-between-related-posts/

I am not sure which step is missing in your website, if you need more assistance for it, please provide a test site with the same problem, also point out the problem page URL and form URL, I can setup a demo for you.

Private message box enabled.

#1766305

Thank you for the links. I will document what i am seeing for each case and give you access to my site today.

I had a quick question, I want to confirm that you do NOT need the layouts plugin for either case #1 or case #2?

Thank you...

#1766433
Screen Shot 2020-09-04 at 10.53.29 AM.png
Screen Shot 2020-09-04 at 11.10.20 AM.png

Please review the following documentation. I am following the exact steps in the documentation and please see screenshots to when I do not see the same screens as listed in the documentation:

I have a many to many relationships between a custom category type called "Showroom" and Woocommerce Products.

The relationship form created is called: Add Products to Showrooms Form
I would like to do the following:
1. Add Any showroom to Any Product
2. Edit Existing connections (the Price of a product in a Showroom)
3. Add Any showroom to a Specific Product
4. Add Any Product to a Specific Showroom
5. Delete a Connection between a specific product and a specific showroom

CASE 1: Add Any showroom to Any Product
created a page called hidden link
and inserted the form block object and linked to the above form. I selected link type:
Connect between any Showrooms and a Product as a Showrooms Product
THIS WORKS GREAT.

CASE 2: Edit Existing connections (the Price of a product in a Showroom)
steps: (following this documentation as requested: https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/editing-existing-connections-between-related-posts/
1. Create a template for editing mode: Editing-Mode Template for Showrooms and Products Relationships
2. Create Form: Add Products to Showrooms Form
3. Insert form in #2 into the template in #1: This is where i have an issue:
The documentation says to add a Forms block (see image 1)
When I do this I do not get the wizard shown in the documentation (see image 2)

ANY IDEA WHAT I AM DOING WRONG? I KNOW IF I SELECT THE FIELDS AND THE FIELDS AND TEXT BLOCK I CAN GET TO THE ABOVE WIZARD BUT THAT IS NOT WHAT THE DOCUMENTATION SAYS. PLEASE LET ME KNOW WHAT I AM DOING WRONG.

ONCE WE REOLSVE THIS I WILL MOVE FORWARD...

thank you.

#1766453

Also, how do i hide login info in a post to this ticket? i do not see the option.

thank you.

#1767657

As I mentioned above, you can provide a test site with the same problem, fill below private detail box with your test site credentials, also point out the problem page URLs and form URLs, I can setup a demo for you.

Private detail box enabled again.

#1768689

I have tried the credentials you provided above, they are not valid, I get these errors:
Error: The password you entered for the username tools**-admin is incorrect

Please check it, make sure they are valid, also point out the problem page URLs and form URLs, thanks

#1768691

I changed the password and checked it and i can login., please validate.

AS for links.. i have copied the CASE 2 and added links..

CASE 2: Edit Existing connections (the Price of a product in a Showroom)
steps: (following this documentation as requested: https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/editing-existing-connections-between-related-posts/
1. Create a template for editing mode: Editing-Mode Template for Showrooms and Products Relationships - hidden link

2. Create Form: Add Products to Showrooms Form -
hidden link

3. Insert form in #2 into the template in #1: This is where i have an issue:
The documentation says to add a Forms block (see image 1)
When I do this I do not get the wizard shown in the documentation (see image 2)

ANY IDEA WHAT I AM DOING WRONG? I KNOW IF I SELECT THE FIELDS AND THE FIELDS AND TEXT BLOCK I CAN GET TO THE ABOVE WIZARD BUT THAT IS NOT WHAT THE DOCUMENTATION SAYS. PLEASE LET ME KNOW WHAT I AM DOING WRONG.

the images i am referring to are in the original post..

thank u

#1768737
edit-mode.JPG
names.JPG

Thanks for the details, the document is based on classic editor, but you are using Blocks editor, so there is confusing, I have done below modifications in your website:

1) Recreate the many-to-many relationship "Showroom Products (Int Table)", in step "Names", enable option: Intermediary Post Type visible in WordPress admin menu
See screenshot names.JPG

2) Edit the showroom post, relate with some other product posts:
hidden link

3) Create a view "Edit relationship showrooms-product":
hidden link
- Query product posts
- Filter by:
Select posts in a Showroom Products (Int Table) relationship that are related to the Post where this View is shown.
- In section "Loop item in Edit relationship showrooms-product", display the edit relationship link:
[cred-relationship-form-link form='add-products-to-showrooms-form' role_items='$fromViews' content_template_slug='editing-mode-template-for-showrooms-and-products-relationships']Edit this Showrooms Product[/cred-relationship-form-link]
see screenshot edit-mode.JPG
And delete relationship link:
[cred-delete-relationship role_items='$fromViews' relationship='showrooms-product' redirect='self']Delete this relationship[/cred-delete-relationship]

4) Edit single showroom post content template:
hidden link
at the bottom, display above view "Edit relationship showrooms-product"

Test it in front-end, it works fine

#1771291

thank you for the response. I have been trying to set up my own view and edit so that I can fully understand what you did.

First question, I want to add the price which is stored in the intermediary table between Products and Showrooms. I tried adding this to the content template in the view:
[types field='price'][/types]

this did not work. I then thought maybe in the view we should have selected the "Showroom Products Intermediary Posts" in the content section. this did not work.

Thank you.

#1771473

I was able to figure out how to add the price for the intermediary table so I resolved that issue.

Next question, I would like to deal with the use case for how to add a given product to a showroom that they choose.

in the end, I think I will need to use shortcode to add a link to the product page:
hidden link

i created these with the template builder.

But for now would you help me setup a page to add a product to a showroom?

Thank you.

#1771533

I have checked the URL you mentioned above, it is a single product post, and you are using Elementor editor to design the product post content, so the Toolset content template won't work, as a result, the relationship form link won't work too.
See our document:
https://toolset.com/course-lesson/using-toolset-with-elementor-page-builder/
Limitations when using Elementor and Toolset templates together

In your case, you can try these:
1) Follow our document to design the single product post with Toolset Content template:
https://toolset.com/documentation/user-guides/views/getting-started-woocommerce-views/

2) Then you will be able to setup the relationship form links by following the same document in above content template:
https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/

#1772793

Ok thank you very much.

i created a template for the single product. that worked great. I am trying to add a link to send this to the form I created so that it will have the product selected and the user can then choose the showroom. I have tried several ways and none of the ways seem to work. When i follow the directions and add the Fields and tex - then select the Forms block it inserts
tiny_mce_marker .

Please let me know what i am doing wrong.

Thank you again.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.