public function addItem($p_strName, $p_iQuantity, $p_iGrossAmt, $p_strEAN = "") {

    if (empty($p_strName) || empty($p_iQuantity) || !isset($p_iGrossAmt)) {
      throw new GiroCheckout_SDK_Exception_helper('Name, quantity and amount are mandatory for cart items');
    }

    $aItem = array(
      "name" => $p_strName,
      "quantity" => $p_iQuantity,
      "grossAmount" => $p_iGrossAmt
    );

    if (!empty($p_strEAN)) {
      $aItem["ean"] = $p_strEAN;
    }

    $this->m_aItems[] = $aItem;
  }
public function addItem($p_strName, $p_iQuantity, $p_iGrossAmt, $p_strEAN = "") {

    if (empty($p_strName) || empty($p_iQuantity) || !isset($p_iGrossAmt)) {
      throw new GiroCheckout_SDK_Exception_helper('Name, quantity and amount are mandatory for cart items');
    }

    $aItem = array(
      "name" => $p_strName,
      "quantity" => $p_iQuantity,
      "grossAmount" => $p_iGrossAmt
    );

    if (!empty($p_strEAN)) {
      $aItem["ean"] = $p_strEAN;
    }

    $this->m_aItems[] = $aItem;
  }
public function addItem ( $ p_strName , $ p_iQuantity , $ p_iGrossAmt , $ p_strEAN = "" ) { if ( empty ( $ p_strName ) || empty ( $ p_iQuantity ) || ! isset ( $ p_iGrossAmt ) ) { throw new GiroCheckout_SDK_Exception_helper ( 'Name, quantity and amount are mandatory for cart items' ) ; } $ aItem = array ( "name" => $ p_strName , "quantity" => $ p_iQuantity , "grossAmount" => $ p_iGrossAmt ) ; if ( ! empty ( $ p_strEAN ) ) { $ aItem [ "ean" ] = $ p_strEAN ; } $ this -> m_aItems [ ] = $ aItem ; }
Add item to cart.

@param string $p_strName Item name
@param integer $p_iQuantity Number of items of this kind in the cart
@param integer $p_iGrossAmt Gross amount (value) of the item
@param string $p_strEAN (optional) Item id number
@throws GiroCheckout_SDK_Exception_helper
Add item to cart .