private function removeCouponFromItems($code = null)
    {
        foreach ($this->getItems() as $item) {
            if (isset($item->code) && (empty($code) || $item->code == $code)) {
                $item->code = null;
                $item->coupon = null;
            }
        }
    }