Skip Navigation

[Résolu] Need help with Custom Data Structure

This support ticket is created Il y a 3 années et 5 mois. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 réponses, has 2 voix.

Last updated by Jo4nny8 Il y a 3 années et 5 mois.

Assisted by: Raja Mohammed.

Auteur
Publications
#1832451

I am building an internal CRM with toolset and am stuck on how to organise some data correctly.

The part I am struggling with is a 'product' custom post type which is used to store the company sales products.

The company sells kitchen cabinets and each cabinet has multiple variations in size (mainly widths of 300,400,500,600,700,800,900,100mm). Each cabinet is also available in 55 different colours.

My problem comes in how to assign relationships between each size / colour when the product is assigned to an order for a customer.

My current relationship structure is as follows. (the '' terms are custom post types)

Each 'customer' has a one to many relationship with a 'quote' or 'contract' (I/e the company provides many quotes or contracts to 1 customer.)

Each 'quote' or 'contract' has a many to many relationship with a 'product' (ie products can be assigned to many quotes or contracts)

The idea is that I will create a new quote (front end or backend) for a customer, assign the products to this quote and send the contract to the customer for signing etc.

What would be the best way to structure the products that I can easily form a new 'quote' and add the products. Is my variation of each product thinking the best way, or should I create a new product per variation to make things cleaner and easier?

(the site is custom and will be preferably written using the apis / php available as opposed to views)

#1834163

Raja Mohammed
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello there,

This is a subjective issue and there are more than one possible ways that you can manage product variations,.

However, I see your request as no different than how WooCommerce manages the product variations, where each of the product variation are stored as a separate products linked to a parent product, In this way with the Many to Many relation with Orders and Products you can easily map the variation products for each orders also you can have more than one variation for each order. Creating the variations as separate products makes it is easy to query for other use cases.

You can refer to this write up on how product variations are managed in WooComerce : hidden link

I hope this help you better.

kind regards
Raja

#1835171

Thanks for the reply.

Would you therefore suggest creating separate products in the admin or use a repeatable post group since these are essentially separate posts, albeit under a hidden post type which can still be queried on the front end?

#1835283

Raja Mohammed
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

It is best to a have them as separate products,

I am not exactly sure how repeatable field groups can help here as you cannot have a direct relation with orders post type and Repeatable field group of a product post type. I hope you get what i mean ?

#1835323

My issue is resolved now. Thank you!

Ill create separate products for each variation. Thank you

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