Skip Navigation

[Resolved] Custom Post Types with woocommerce question

This support ticket is created 5 years, 1 month 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Beda 5 years, 1 month ago.

Assisted by: Beda.

Author
Posts
#1364437

I'd like to add the ability to support vendors for products. Structurally it seems doable. I would create a CPT for vendors and add a many-to-many relationship between products and vendors. But how much control will I have to display that information in a meaningful way? Does toolset have any limitations as far as accessing the woocommerce data? Can I build custom views of all the products a vendor sells? A support ticket I read made it sound like the invoicing would be difficult because that's all woocommerce code. Is there any additional documentation you could point me to like interfacing toolset with APIs? I'm just trying to get an idea of where I might encounter issues. Thanks, Jim

#1364565

1. how much control will I have to display that information in a meaningful way

I am not sure what you mean by a meaningful way, this would require more details to confirm wether yes or no.
However, with Toolset you can display information of Products (in either customized single product templates, the shop, or the product category archives.)
You can also list WooCommerce products, and orders (but not invoices) with Views, creating lists of those where you can add practically any sort of information that is bound to Products.
Please have a look at WooCommerce Views - which is the plugin that will help you customize the WooCommerce Templates.
Views instead will help you display the Products in custom lists.
https://toolset.com/documentation/user-guides/getting-started-woocommerce-views/

2. Does toolset have any limitations as far as accessing the woocommerce data?

Yes, practically all data that is not made publicly queryable by WooCommerce, or somehow using mechanisms that can only be controlled in WooCommerce (such as invoices) can't really be controlled, or displayed with Toolset.
However, you can get data from Orders, Products, their categories.
Since Products are simple posts, and their data mostly fields and taxonomies, it's just like you would work with native posts, categories and custom fields.
Note that WooCommerce Views also adds several features to calculate Static Product Fields, and display such data in a view (and query by)
It's elaborated closer in the DOC shared above.

Note, the main limitation in WooCommerce/Toolset is the creation and manipulation of products thru Toolset Forms.
Here is a DOC about what you can do to products thru a form, and what not:
https://toolset.com/documentation/user-guides/creating-woocommerce-products-using-cred-forms/

This is by large the biggest limitation we have - and it's not related to display or "getting data", but "posting data", hence I think it will not concern you in this case, but sharing it in case you also plan to add products with Toolset.

3. Can I build custom views of all the products a vendor sells?

If your product gets connected thru a relationship to the vendor somehow ahead of displaying, yes.
Toolset Views will allow you to (for example) list products, that are "related" to the current (or other) Post (which might the vendor in your case).
Post relationship filters are used to display such lists, they are elaborated here:
Video: hidden link
DOC: https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/

The same approaches are valid for any post type in any relationship, hence also Products <> Any Post Type.

4. Is there any additional documentation you could point me to like interfacing toolset with APIs?

Toolset has several API's.
I suggest starting here to get a hunch of what's possible:
https://toolset.com/documentation/programmer-reference/

Please let me know if you have further questions related to the Toolset/WooCommerce integration.