/**
  *	@remove ALL items from cart and delete total as well
  *	@access public
  *	@return bool
  */
 public function delete_cart()
 {
     EE_Registry::instance()->load_helper('Line_Item');
     $deleted = EEH_Line_Item::delete_all_child_items($this->_grand_total);
     if ($deleted) {
         $deleted += $this->_grand_total->delete();
     }
     return $deleted;
 }
Ejemplo n.º 2
0
 /**
  *	@remove ALL items from cart and delete total as well
  *	@access public
  *	@return bool
  */
 public function delete_cart()
 {
     $deleted = EEH_Line_Item::delete_all_child_items($this->_grand_total);
     if ($deleted) {
         $deleted += $this->_grand_total->delete();
         $this->_grand_total = null;
     }
     return $deleted;
 }
 /**
  * _delete_line_item
  *
  * @access public
  * @param \EE_Line_Item $line_item
  * @return boolean
  */
 public static function _delete_line_item(EE_Line_Item $line_item)
 {
     if ($line_item->ID()) {
         return $line_item->delete();
     } else {
         return EE_Registry::instance()->CART->delete_items($line_item->code());
     }
 }