Tell us what are you trying to do?
Hello,
I am working on a product catalog.
In the single product page, I want to display related products.
The criterion would be that the associated products share the same product category (custom taxonomy term) as the current post category.
But I would like admin editors to be able to manually choose which related products to display from a list.
Is there a similar example that we can see?
Since it doesn't seem possible to create a relationship between posts belonging to the same custom post type, I searched the Toolset forum and found this tread:
https://toolset.com/forums/topic/need-to -create-a- custom-field-which-displays-links-to-related-messages-of-the-same-type /
It's quite old and I wonder if it is still relevant today? Or is there a better solution?
Thank you
Hello and thank you for contacting the Toolset Support Forum.
I am sorry, but I could not find the ticket that you have referred to here. If you still have it on your bookmarks, can you share it again and I'll check if the solution on it is still relevant?
In the meantime, I'll suggest using an intermediate post type. Let's call it "Related Products". Then implement a one-to-one relationship from Products to "Related products", and a one-to-many relationship from "Related Products" to Products.
This way, a product can have only one "Related product" post. And that post can have multiple children's products. Then you can build a view that will display the products linked to the "Related Products" post, and you can put it inside a content template. Then display that content template by setting its context to the "Related product" post linked to the current product. Does it make sense? Let me know if you have further questions or if you need a concrete example, I would be happy to prepare it.
Hi Jamal,
Thank you for your reply.
The forum article I was referred to should be available here:
https://toolset.com/forums/topic/manually-select-posts-to-show-in-view-and-related-posts-by-category/
https://toolset.com/forums/topic/need-to-create-a-custom-field-that-shows-links-to-related-posts-of-the-same-type/
Regarding the solution you are proposing, I must admit that you have lost me.
Do you mean, I have to create a Related Products custom post type with the same posts as the Products custom post type?
Regards
Well, the solution suggested in that ticket is probably more efficient than the one I suggested. It is still relevant and will work for you with the current versions of Toolset plugins.
If you are unsure of how to implement it, allow me temporary access to your website and I'll try to help. Your next reply will be private to let you share credentials safely. Please take a database backup before sharing credentials.
Hi Jamal,
Thank you for your support.
If you can handle it, let me try it alone.
If I encounter any difficulties I will allow myself to open a new ticket.
Regards
My issue is resolved now. Thank you!