src/CartItem.php
public function set($key, $value)
    {
        switch ($key) {
            case 'quantity':
                $this->setCheckTypeInteger($value, $key);
            break;
            case 'price':
            case 'tax':
                $this->setCheckIsNumeric($value, $key);

                $value = (float) $value;
        }

        $this->data[$key] = $value;

        return $this->getId();
    }
public function set($key, $value)
    {
        switch ($key) {
            case 'quantity':
                $this->setCheckTypeInteger($value, $key);
            break;
            case 'price':
            case 'tax':
                $this->setCheckIsNumeric($value, $key);

                $value = (float) $value;
        }

        $this->data[$key] = $value;

        return $this->getId();
    }
public function set ( $ key , $ value ) { switch ( $ key ) { case 'quantity' : $ this -> setCheckTypeInteger ( $ value , $ key ) ; break ; case 'price' : case 'tax' : $ this -> setCheckIsNumeric ( $ value , $ key ) ; $ value = ( float ) $ value ; } $ this -> data [ $ key ] = $ value ; return $ this -> getId ( ) ; }
Set a piece of data on the cart item.

@param string $key
@param mixed  $value

@return string
Set a piece of data on the cart item .