function getCurrentGC() { $gc_code = modApiFunc('Request', 'getValueByKey', 'gc_code'); $gc = new GiftCertificate($gc_code); if (modApiFunc('Session', 'is_Set', 'gc_update_action_errors')) { $SessionPost = modApiFunc('Session', 'get', 'SessionPost'); $gc->InitByMap($SessionPost); modApiFunc('Session', 'un_Set', 'SessionPost'); } return $gc; }
function addCurrentGiftCertificate($gc_code) { $errors = array(); if ($this->isCodeValid($gc_code) && $this->doesCodeExist($gc_code)) { $gc = new GiftCertificate($gc_code); if ($gc->isError() == true) { $errors = $gc->errors; } else { if ($gc->isApplicable() == true) { $this->__gc_current_list[$gc_code] = $gc; } else { $errors[] = GC_E_NOT_APPLICABLE; } } } else { $errors[] = GC_E_INVALID_CODE; } return $errors; }