Skip Navigation

[Resolved] Using the same taxonomy for (custom) posts and (custom) products, and more …

This support ticket is created 5 years, 11 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 5 replies, has 2 voices.

Last updated by Luo Yang 5 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#1176268

Hello,

I am developing a portal around training. There will be articles (posts and custom posts), custom products, different types of products (I saw Toolset tutorials about this and other topics), different types of users with different registration forms and different roles, ...

In summary, this looks more like a Training Marketplace, with some specific features.

I am thinking of using wc marketplace to handle multiple sellers, but I am not obliged.
I was running Divi Builder, but it was limited and not very well intergrated with Toolset. So I'm using Elementor Pro now.
I still hesitate regarding the choice of my theme. I am looking for a theme that is the most compatible with Toolset and Elementor Pro (maybe you'll tell me that I don't need a theme at all).

Of course, I'm not asking you to tell me how to do all that follows. It is a specialist job and it deserves salary. If it doesn't cost you a lot of time, I take it obviously. But tell me at least if it is possible with your different tools (combined with Elementor? And possibly other tools?).

I am a developer and I can do complementary developments outside the 'standard' uses of plugins and themes.

I can also adapt or drop some features according to your suggestions and answers.

Here are some of my needs:

- I would like to use the same taxonomy in the posts and the products, it will allow me among other things to display the products related to the posts

- I want to customize my single posts, my archives and restrict archives to categories and regions chosen by the registered user in his profile

- I would like to manage different types of users and sellers with different roles and different types of products

- I would like to highlight/rank products according to the options subscribed by the advertiser/seller

- I would like to set up a complete and dynamic search interface based on my taxonomy and the choices/subscriptions of registered users

- According to the geocalisation of the IP address of the visitor, I would like to be able to restrict by default the view of this visitor to articles and products associated with the region of his IP address

- I wonder (I did, however, check, but without success) if it is possible and above all viable to set up a taxonomy where a category can have several parents

This represents 20% to 30% of my specific needs, but it will give me a good start-up base.

I thank you if you read me so far.

I wish you a happy new year 2019, with a lot of joy and full of health.

Best regards,
Mansario

#1176726

Dear Mansario,

Happy new year. There are lots of questions in this thread, I am trying to answer them one by one.

Q1) I would like to use the same taxonomy in the posts and the products, it will allow me among other things to display the products related to the posts

Yes, it is possible to share the same taxonomy to multiple post types, see our document:
https://toolset.com/documentation/user-guides/create-custom-taxonomies/#3-select-post-types
You can connect the taxonomy to other post types. Using the same taxonomy for different types will allow you to connect between them and create advanced content displays on the site’s front-end.

Screenshot:
hidden link

Q2) I want to customize my single posts, my archives and restrict archives to categories and regions chosen by the registered user in his profile
Yes, it is possible to customize single posts and archives pages, see our document:

For example, you can customize single post with Views content template:
https://toolset.com/documentation/user-guides/setting-view-templates-for-single-pages/
And customize archive page with Views wordpress archive:
https://toolset.com/documentation/user-guides/creating-wordpress-custom-post-archives/

For the question "restrict archives to categories and regions chosen by the registered user in his profile":
It depends on how do you setup the "regions chosen by the registered user in his profile", if the "regions" is a custom user field, you can get the "regions" field value with Views shortcode
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-user

And pass the field value to shortcode [wpv-conditional], check if current post has specific term, then display what you want, for example:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/displaying-taxonomies-conditionally/#specific

Q3) i would like to manage different types of users and sellers with different roles and different types of products
You can setup custom user roles with Access plugin:
https://toolset.com/documentation/user-guides/managing-wordpress-admin-capabilities-access/
And specific each user role's access to custom post types:
https://toolset.com/documentation/user-guides/setting-access-control/

Q4) I would like to highlight/rank products according to the options subscribed by the advertiser/seller

Similar as Q2), you can use shortcode [wpv-conditional] to check if it is a highlight/rank products according to the options subscribed by the advertiser/seller, and display what you want.

Q5) I would like to set up a complete and dynamic search interface based on my taxonomy and the choices/subscriptions of registered users

You can setup the custom search form and search result with Views plugin, see our document:
https://toolset.com/documentation/user-guides/front-page-filters/

Custom search form supports query posts, taxonomy filter and custom post fields filter, but it does not support query users yet.

Q6) According to the geocalisation of the IP address of the visitor, I would like to be able to restrict by default the view of this visitor to articles and products associated with the region of his IP address

There isn't such a built-in (IP address) feature within Toolset plugins, but Toolset map plugin supports the Distance filter by user's location, see our document:
https://toolset.com/documentation/user-guides/display-on-google-maps/filtering-and-ordering-map-markers-by-distance/
Filtering and Ordering Map Markers by Distance

Q7) I wonder (I did, however, check, but without success) if it is possible and above all viable to set up a taxonomy where a category can have several parents

No, this is not possible within WordPress taxonomy, in hierarchical custom taxonomy, one term can only have one parent term, just like WordPress built-in taxonomy "Category".

In your case, it needs many-to-many relationship, you might consider the many-to-many relationship between post types, see our document:
https://toolset.com/documentation/post-relationships/

If there is any new question, new ticket please, that will help other users to find the answers.

#1176755

Hello,

Thank you very much for those very clear answers. I did not expect as much. Thanks again !

Just to close these questions, in response to one of your questions that came back twice:

I will present (in one way or another) some of the taxonomy in forms in the registered user's space. Maybe at the time of registration too. The user will select checkboxes of taxonomies that interest him (topics of articles, regions, ...). And that will be basically my filter to customize the site's display for him. Only the posts and products and custom posts and custom products associated with its choices in this common taxonomy will be displayed.

Is this still feasible? Rather easily with Toolset and Elementor Pro?

Thanks a lot and best regards,

Mansario

#1176757

Dear Mansario,

For the new question:
I will present (in one way or another) some of the taxonomy in forms in the registered user's space. Maybe at the time of registration too.

There isn't taxonomies feature within custom user field, so it is not possible present some of the taxonomy in forms in the registered user's space by default.

The WordPress taxonomies are for custom posts, see WordPress document:
https://codex.wordpress.org/Function_Reference/register_taxonomy

$object_type
(array/string) (required) Name of the object type for the taxonomy object. Object-types can be built-in Post Type or any Custom Post Type that may be registered.

In your case, you might consider create another post type, for example "my-cpt", and register taxonomy to post type "my-cpt", each "my-cpt" post's author is different user.
After user login into your website, let him to create a new "my-cpt" post, and specific terms in your custom taxonomy.

See our document:
https://toolset.com/documentation/post-relationships/how-to-create-custom-searches-and-relationships-for-users/

If there is any new question, new ticket please, thanks

#1176971

Dear Luo Yang, you are the best.

Time to develop a portal ...

I keep you informed in case of complication ... & success.

Thanks again !

#1177406

OK, please update here if you still need assistance for them. thanks