21282 Posts in 5730 Topics by 2601 members
| Go to End | ||
| Author | Topic: | 5190 Views |
-
Re: Displaying/Editing Many-to-Many Extra Fields

29 September 2010 at 5:01am Last edited: 29 September 2010 5:04am
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'));
} -
Re: Displaying/Editing Many-to-Many Extra Fields

17 December 2011 at 3:24am Last edited: 17 December 2011 3:24am
The CRUD interface would be really useful. If I knew how to write one myself, I would. :-/
-
Re: Displaying/Editing Many-to-Many Extra Fields

17 December 2011 at 3:56am
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.
-
Re: Displaying/Editing Many-to-Many Extra Fields

20 October 2012 at 9:48pm
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 | ||
| Go to Top |




