Jump to:

21282 Posts in 5730 Topics by 2601 members

General Questions

SilverStripe Forums » General Questions » Displaying/Editing Many-to-Many Extra Fields

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

Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 5190 Views
  • Tonyair
    Avatar
    Community Member
    81 Posts

    Re: Displaying/Editing Many-to-Many Extra Fields Link to this post

    Hello, guys.

    When I'm executing that function i'm getting +2 in the Count field
    for example i'm getting Product->items[0]->Count = 1
    echo $count returns 2, but after $Product->add($add,array('Count' => $count)); I'm getting 3 in Basket_Products table, but

    $Product->add($add,array('Count' => '2')); works well

    What's wrong?

    $Product = $basket->Products('ProductID = '.$add);
    if(count($Product) > 0){
       $count = $Product->items[0]->Count;
       $count++;
       echo $count;
       $Product->add($add,array('Count' => $count));
    } else {
       $Products = $basket->Products();
       $Products->add($add,array('Count' => '1'));
    }

  • johnofjack
    Avatar
    Community Member
    22 Posts

    Re: Displaying/Editing Many-to-Many Extra Fields Link to this post

    The CRUD interface would be really useful. If I knew how to write one myself, I would. :-/

  • swaiba
    Avatar
    Forum Moderator
    1674 Posts

    Re: Displaying/Editing Many-to-Many Extra Fields Link to this post

    Being as this thread dates back to 2009 and SS3 is coming out with DataLists and DataGrids to replace alot of the standard tech it might be more appropriate to raise this ASAP on teh dev list rather than in the forums.

  • BenWu
    Avatar
    Community Member
    65 Posts

    Re: Displaying/Editing Many-to-Many Extra Fields Link to this post

    for SS2.4, you can use the itemsetfield module http://www.silverstripe.org/ItemSetField/

    for SS3.0, I am looking for the same thing.

    5190 Views
Page: 1 2
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.