-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
Now to use the decrease the quantity of an Item I had to make this cycle:
$positions = Yii::app()->shoppingCart->getPositions();
foreach($positions as $position) {
if ($position->id == $id){
$total = $position->getQuantity();
Yii::app()->shoppingCart->update($position,$total-1); //1 item with id=1, quantity=2.
$price = $position->getSumPrice();
}
}
Is this right?
If it is a
Yii::app()->shoppingCart->getPosition($book);
to load directly one resource without cycle trought all could be usefull.. Or maybe I just didn't find the right method to do this...
Kindly waiting for a feedback :) Thanks for your great Job!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels