Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

manymanycomplextablefield question


Reply


3 Posts   432 Views

Avatar
voodoochile

Community Member, 52 Posts

19 July 2012 at 11:31pm

Hi

hope someone can answer this or point me in the right direction at least.

i have 3 data objects all being used in the cms only, i have them setup in the following way

Quote, Product, Weight

Each quote requires several products so has a many_many relationship to products and allows me to select products from a list.
Each product has a has_many relationship to weight.
The weight object has a has_many relationship to the quote.

the product and weight are accessed in a manymanycomplextablefield in the quote

so far it looks to be working except that when i go to add a weight in the popup for the selected product i cant the table will display the weight but will not let me add one.

what im trying to acheive is in a quote select a list of products and then add weights to them to be stored for each quote.
so the product and the weight are related to eachother and to the quote as well

Avatar
swaiba

Forum Moderator, 1805 Posts

20 July 2012 at 1:28am

I think you have just run into the scaffolding "wall" - I think your option is to remove and remake the complextable field in the getCMSFields

But really, why are you re-inventing the wheel? It sounds like you are make ecommerce with variations - I'd choose an existing module (silvercart for example) that already does all kinds of things like this.

Avatar
voodoochile

Community Member, 52 Posts

20 July 2012 at 11:15am

Edited: 20/07/2012 11:16am

Hi thanks for the reply Swaiba

But really, why are you re-inventing the wheel?

3 reasons

1 Bugatti didn't put an off the shelf wheel on the Veyron
2 I enjoy the Challenge
3 because I'm Trying to Learn how silverstripe works and how to build applications for silverstripe by doing a real project.
Unfortunatly I'm a bit isolated where i live and don't know anyonenearby that i can discuss with and learn from, so i only have what i have to teach myself.

so i'm not so much reinventing the wheel as more building a new whell to do a particular job, while an ecommerce module may fit the purpose to a point and get the job done, i'm not really learning anything new or getting the result i want.

I will Try rebuilding the complex tablefield, i also thought that i should look at how the data i want to store and relate could be arranged better so that the relationships aren't so complex but still meet my needs.

thanks again