Thanks, but not sure I explained what I want to do. In plain english I'd like to achieve something like:
If the quantity of a product {$product_item.item_count} is greater than 1 set quantiy to 1 & echo "you have already ordered {$product_item.object_name}!!"
For some reason I can't seem to re-set {$product_item.item_count}?
Your code displays correctly when item_count is greater than 1. I have been tying to insert something like: <let>($product_item.item_count=1)</let> in the basket loop [& lots of variations in syntax] with no luck.
$product_item.item_count should aways be 1 for this application.
Ahh! Becoming clearer. The data has already been written? So I could nobble the kernal here [is this a good idea?]
if ( $itemID )
{
/* If found in the basket, just increment number of that items: */
$item =& eZProductCollectionItem::fetch( $itemID );
$item->setAttribute( 'item_count', 1 + $item->attribute( 'item_count' ) );
$item->store();
}
...or maybe set item_count to 1 in the template, display a warning & present a button to write the quantiy???