Skip Navigation

[Résolu] Need help with Custom Data Structure

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

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

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)

Ce sujet contient 4 réponses, a 2 voix.

Dernière mise à jour par Jo4nny8 Il y a 3 années et 8 mois.

Assisté par: 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

Les langues: Anglais (English )

Fuseau horaire: 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 : lien caché

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

Les langues: Anglais (English )

Fuseau horaire: 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

Ce ticket est maintenant fermé. Si vous êtes un client de Toolset et que vous avez besoin d'aide, veuillez ouvrir un nouveau ticket d'assistance