예제 #1
0
 /**
  *  Remove a product from shopping cart
  */
 public function delete()
 {
     $item = ActiveRecordModel::getInstanceByID('OrderedItem', $this->request->get('id'), ActiveRecordModel::LOAD_DATA, array('Product'));
     $this->setMessage($this->makeText('_removed_from_cart', array($item->getProduct()->getName($this->getRequestLanguage()))));
     $this->order->removeItem($item);
     SessionOrder::save($this->order);
     return new ActionRedirectResponse('order', 'index', array('query' => 'return=' . $this->request->get('return')));
 }