Ejemplo n.º 1
0
    if (Agile_Logging == 'on') {
        $paypal->log_message("tmppass:"******"email:" . $customer->email);
    }
    try {
        Mail::Send(intval($oldcart->id_lang), 'account', 'Welcome!', array('{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, '{email}' => $customer->email, '{passwd}' => $tmppass), $customer->email, $customer->firstname . ' ' . $customer->lastname);
    } catch (Exception $e) {
        if (Agile_Logging == 'on') {
            $paypal->log_message('error at sending email:' . $e->getMessage());
        }
    }
}
$addresses = $customer->getAddresses($oldcart->id_lang);
if ($findid = $paypal->findExistingAddress($addresses)) {
    $address = new Address($findid);
} else {
    $address = new Address();
    $address->id = 0;
    $address->id_customer = $customer->id;
    $address->address1 = $_POST['address_street'];
    $address->city = $_POST['address_city'];
    if (empty($address->city)) {
        $address->city = "Unknown";
    }
    $address->postcode = utf8_encode($_POST['address_zip']);
    $address->phone = isset($_POST['contact_phone']) ? utf8_encode($_POST['contact_phone']) : "";
    $address->id_country = Country::getByIso($_POST['address_country_code']);
    $theCountry = new Country($address->id_country);
    if (isset($_POST['address_state']) and strlen($_POST['address_state']) > 0) {