Jump to:

23487 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » manymanycomplextablefield question

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

Page: 1
Go to End
Author Topic: 358 Views
  • voodoochile
    Community Member
    52 Posts

    manymanycomplextablefield question Link to this post


    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

  • swaiba
    Forum Moderator
    1792 Posts

    Re: manymanycomplextablefield question Link to this post

    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.

  • voodoochile
    Community Member
    52 Posts

    Re: manymanycomplextablefield question Link to this post

    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

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.