function create_paypal_link($orders_id = '', $cleanlink = false) { global $last_order, $PHP_SELF; if ($orders_id == '') { $orders_id = $last_order; } $check_query = xtc_db_query("SELECT *\n FROM " . TABLE_PAYPAL_PAYMENT . "\n WHERE orders_id = '" . (int) $orders_id . "'"); if (xtc_db_num_rows($check_query) < 1) { require_once DIR_WS_CLASSES . 'order.php'; $order = new order($orders_id); $hash = md5($order->customer['email_address']); if (defined('RUN_MODE_ADMIN')) { $link = xtc_catalog_href_link('callback/paypal/' . $this->code . '.php', 'oID=' . $orders_id . '&key=' . $hash, 'SSL'); } else { $link = xtc_href_link('callback/paypal/' . $this->code . '.php', 'oID=' . $orders_id . '&key=' . $hash, 'SSL'); } if ($cleanlink === true) { return $link; } $image = strtoupper($_SESSION['language_code']) == 'DE' ? 'epaypal_de.gif' : 'epaypal_en.gif'; if (basename($PHP_SELF) == FILENAME_CHECKOUT_SUCCESS) { $image = '<img src="' . DIR_WS_BASE . DIR_WS_ICONS . $image . '" id="paypalcartbutton" />'; } else { $image = '<img src="' . (ENABLE_SSL == true ? defined('HTTPS_CATALOG_SERVER') ? HTTPS_CATALOG_SERVER : HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG . DIR_WS_ICONS . $image . '" id="paypalcartbutton" />'; } $checkout_button = '<a href="' . $link . '">' . $image . '</a>'; return $checkout_button; } }
$notify_comments = $comments; } else { $notify_comments = ''; } // assign language to template for caching $smarty->assign('language', $_SESSION['language']); $smarty->caching = false; // set dirs manual $smarty->template_dir = DIR_FS_CATALOG . 'templates'; $smarty->compile_dir = DIR_FS_CATALOG . 'templates_c'; $smarty->config_dir = DIR_FS_CATALOG . 'lang'; $smarty->assign('tpl_path', 'templates/' . CURRENT_TEMPLATE . '/'); $smarty->assign('logo_path', HTTP_SERVER . DIR_WS_CATALOG . 'templates/' . CURRENT_TEMPLATE . '/img/'); $smarty->assign('NAME', $check_status['customers_name']); $smarty->assign('ORDER_NR', $oID); $smarty->assign('ORDER_LINK', xtc_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL')); $smarty->assign('ORDER_DATE', xtc_date_long($check_status['date_purchased'])); $smarty->assign('NOTIFY_COMMENTS', nl2br($notify_comments)); // Tomcraft - 2009-10-10 - Fixed wordwrap in notify_comments $smarty->assign('ORDER_STATUS', $orders_status_array[$status]); $html_mail = $smarty->fetch(CURRENT_TEMPLATE . '/admin/mail/' . $order->info['language'] . '/change_order_mail.html'); $txt_mail = $smarty->fetch(CURRENT_TEMPLATE . '/admin/mail/' . $order->info['language'] . '/change_order_mail.txt'); xtc_php_mail(EMAIL_BILLING_ADDRESS, EMAIL_BILLING_NAME, $check_status['customers_email_address'], $check_status['customers_name'], '', EMAIL_BILLING_REPLY_ADDRESS, EMAIL_BILLING_REPLY_ADDRESS_NAME, '', '', EMAIL_BILLING_SUBJECT, $html_mail, $txt_mail); $customer_notified = '1'; } xtc_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . xtc_db_input($oID) . "', '" . xtc_db_input($status) . "', now(), '" . $customer_notified . "', '" . xtc_db_input($comments) . "')"); $order_updated = true; } if ($order_updated) { $messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success'); } else {
<div class="pageHeadingImage"><?php echo xtc_image(DIR_WS_ICONS . 'heading_configuration.gif'); ?> </div> <div class="flt-l"> <div class="pageHeading pdg2"><?php echo TEXT_PAYPAL_WEBHOOK_HEADING_TITLE; ?> </div> </div> <?php $list = $paypal->list_webhooks(); $new = true; if (count($list) > 0) { foreach ($list as $data) { if ($data['url'] == xtc_catalog_href_link('callback/paypal/webhook.php', '', 'SSL', false)) { $new = false; break; } } } if (!isset($_GET['action']) && $new != false) { echo '<div class="pageHeading flt-l" style="margin: 3px 40px;"><a class="button" href="' . xtc_href_link(basename($PHP_SELF), 'action=new') . '">' . BUTTON_INSERT . '</a></div>'; } include_once DIR_FS_EXTERNAL . 'paypal/modules/admin_menu.php'; ?> <div class="clear div_box mrg5" style="margin-top:-1px;"> <table class="clear tableConfig"> <?php if (isset($_GET['action']) && $_GET['action'] == 'edit') { $list = $paypal->edit_webhook($_GET['id']);
echo date(DATE_FORMAT, $sr->showDate) . SR_SEPARATOR1 . date(DATE_FORMAT, $sr->showDateEnd) . SR_SEPARATOR1; echo $info[0]['order'] . SR_SEPARATOR1; echo $info[$last - 1]['totitem'] . SR_SEPARATOR1; echo $currencies->format($info[$last - 1]['totsum']) . SR_SEPARATOR1; echo $currencies->format($info[0]['shipping']) . SR_NEWLINE; } if ($srDetail) { for ($i = 0; $i < $last; $i++) { if ($srMax == 0 or $i < $srMax) { if ($srExp < 2) { ?> <tr class="dataTableRow" onMouseOver="this.className='dataTableRowOver';this.style.cursor='pointer'" onMouseOut="this.className='dataTableRow'"> <td class="dataTableContent"> </td> <td class="dataTableContent" align="left"> <a href="<?php echo xtc_catalog_href_link("product_info.php?products_id=" . $info[$i]['pid']); ?> " target="_blank"><?php echo $info[$i]['pmodel'] . ' : ' . $info[$i]['pname']; ?> </a> <?php if (is_array($info[$i]['attr'])) { $attr_info = $info[$i]['attr']; foreach ($attr_info as $attr) { echo '<div style="font-style:italic;"> ' . $attr['quant'] . 'x '; // $attr['options'] . ': ' $flag = 0; foreach ($attr['options_values'] as $value) { if ($flag > 0) { echo "," . $value;
} $messageStack->add_session(SUCCESS_BILLING, 'success'); xtc_redirect(xtc_href_link(FILENAME_AFFILIATE_PAYMENT, xtc_get_all_get_params(array('action')) . 'action=edit')); break; case 'update_payment': $pID = xtc_db_prepare_input($_GET['pID']); $status = xtc_db_prepare_input($_POST['status']); $payment_updated = false; $check_status_query = xtc_db_query("select af.affiliate_email_address, ap.affiliate_lastname, ap.affiliate_firstname, ap.affiliate_payment_status, ap.affiliate_payment_date, ap.affiliate_payment_date from " . TABLE_AFFILIATE_PAYMENT . " ap, " . TABLE_AFFILIATE . " af where affiliate_payment_id = '" . xtc_db_input($pID) . "' and af.affiliate_id = ap.affiliate_id "); $check_status = xtc_db_fetch_array($check_status_query); if ($check_status['affiliate_payment_status'] != $status) { xtc_db_query("update " . TABLE_AFFILIATE_PAYMENT . " set affiliate_payment_status = '" . xtc_db_input($status) . "', affiliate_last_modified = now() where affiliate_payment_id = '" . xtc_db_input($pID) . "'"); $affiliate_notified = '0'; // Notify Affiliate if ($_POST['notify'] == 'on') { $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_AFFILIATE_PAYMENT_NUMBER . ' ' . $pID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . xtc_catalog_href_link(FILENAME_CATALOG_AFFILIATE_PAYMENT_INFO, 'payment_id=' . $pID, 'SSL') . "\n" . EMAIL_TEXT_PAYMENT_BILLED . ' ' . xtc_date_long($check_status['affiliate_payment_date']) . "\n\n" . sprintf(EMAIL_TEXT_STATUS_UPDATE, $payments_status_array[$status]); xtc_php_mail(AFFILIATE_EMAIL_ADDRESS, EMAIL_SUPPORT_NAME, $check_status['affiliate_email_address'], $check_status['affiliate_firstname'] . ' ' . $check_status['affiliate_lastname'], '', EMAIL_SUPPORT_REPLY_ADDRESS, EMAIL_SUPPORT_REPLY_ADDRESS_NAME, '', '', EMAIL_TEXT_SUBJECT, nl2br($email), $email); $affiliate_notified = '1'; } xtc_db_query("insert into " . TABLE_AFFILIATE_PAYMENT_STATUS_HISTORY . " (affiliate_payment_id, affiliate_new_value, affiliate_old_value, affiliate_date_added, affiliate_notified) values ('" . xtc_db_input($pID) . "', '" . xtc_db_input($status) . "', '" . $check_status['affiliate_payment_status'] . "', now(), '" . $affiliate_notified . "')"); $order_updated = true; } if ($order_updated) { $messageStack->add_session(SUCCESS_PAYMENT_UPDATED, 'success'); } xtc_redirect(xtc_href_link(FILENAME_AFFILIATE_PAYMENT, xtc_get_all_get_params(array('action')) . 'action=edit')); break; case 'deleteconfirm': $pID = xtc_db_prepare_input($_GET['pID']); xtc_db_query("delete from " . TABLE_AFFILIATE_PAYMENT . " where affiliate_payment_id = '" . xtc_db_input($pID) . "'"); xtc_db_query("delete from " . TABLE_AFFILIATE_PAYMENT_STATUS_HISTORY . " where affiliate_payment_id = '" . xtc_db_input($pID) . "'");
function autoinstall() { $backlink = xtc_href_link(FILENAME_MODULES, 'set=payment&module=pn_sofortueberweisung&action=install', 'SSL'); $header_redir_url = 'http://-USER_VARIABLE_2-'; if (ENABLE_SSL_CATALOG == 'true' && strpos(HTTPS_CATALOG_SERVER, 'tps://') === 2) { $header_redir_url = 'https://-USER_VARIABLE_2-'; // } $html_abortlink = 'http://-USER_VARIABLE_3-'; if (ENABLE_SSL_CATALOG == 'true' && strpos(HTTPS_CATALOG_SERVER, 'tps://') === 2) { $html_abortlink = 'https://-USER_VARIABLE_3-'; // } $alert_http_url = HTTP_SERVER . DIR_WS_CATALOG . 'callback/pn_sofortueberweisung/callback.php'; if (ENABLE_SSL_CATALOG == 'true' && strpos(HTTPS_CATALOG_SERVER, 'tps://') === 2) { $alert_http_url = HTTPS_SERVER . DIR_WS_CATALOG . 'callback/pn_sofortueberweisung/callback.php'; } $html = $this->pnSofortueberweisung->getAutoInstallPage(STORE_NAME, xtc_catalog_href_link(), STORE_OWNER_EMAIL_ADDRESS, DEFAULT_LANGUAGE, DEFAULT_CURRENCY, $html_abortlink, $header_redir_url, $alert_http_url, $backlink, 208); $_SESSION['pn_sofortueberweisung_pw'] = $this->pnSofortueberweisung->password; $_SESSION['pn_sofortueberweisung_pw2'] = $this->pnSofortueberweisung->password2; $_SESSION['pn_sofortueberweisung_hashAlgorithm'] = $this->pnSofortueberweisung->hashfunction; return $html; }
function shopCatalogHrefLink($page, $parameters) { return xtc_catalog_href_link($page, $parameters); }
function create_webhook($data) { // auth $apiContext = $this->apiContext(); $webhookEventTypes = array(); for ($i = 0, $n = count($data['data']); $i < $n; $i++) { if ($data['data'][$i]['name'] != '') { $webhookEvent = new WebhookEventType(); $webhookEvent->setName($data['data'][$i]['name']); $webhookEventTypes[] = $webhookEvent; } } // set webhook $webhook = new Webhook(); $webhook->setUrl(xtc_catalog_href_link('callback/paypal/webhook.php', '', 'SSL', false))->setEventTypes($webhookEventTypes); try { $WebhookList = $webhook->create($apiContext); } catch (Exception $ex) { $this->LoggingManager->log(print_r($ex, true), 'DEBUG'); } $sql_data_array = array(); for ($i = 0, $n = count($data['data']); $i < $n; $i++) { if ($data['data'][$i]['name'] != '') { $sql_data_array[] = array('config_key' => $data['data'][$i]['name'], 'config_value' => $data['data'][$i]['orders_status']); } } $this->save_config($sql_data_array); }
echo ' <tr class="productListing-even">'; } else { echo ' <tr class="productListing-odd">'; } ?> <td class="dataTableContent"><?php echo $affiliate_clickthroughs['affiliate_firstname'] . " " . $affiliate_clickthroughs['affiliate_lastname']; ?> </td> <td class="dataTableContent" align="center"><?php echo xtc_date_short($affiliate_clickthroughs['affiliate_clientdate']); ?> </td> <?php if ($affiliate_clickthroughs['affiliate_products_id'] > 0) { $link_to = '<a href="' . xtc_catalog_href_link(FILENAME_CATALOG_PRODUCT_INFO, 'products_id=' . $affiliate_clickthroughs['affiliate_products_id']) . '" target="_blank">' . $affiliate_clickthroughs['products_name'] . '</a>'; } else { $link_to = "Startpage"; } ?> <td class="dataTableContent"><?php echo $link_to; ?> </td> <td class="dataTableContent" align="center"><?php echo $affiliate_clickthroughs['affiliate_clientbrowser']; ?> </td> </tr> <tr> <td class="dataTableContent"><?php
function process($file) { @xtc_set_time_limit(0); $file = $_POST['configuration']['MODULE_BILLIGER_FILE']; #$config_query = xtc_db_query("UPDATE " . TABLE_CONFIGURATION . " SET configuration_value = ".$_POST['configuration']['MODULE_BILLIGER_SHIPPING_COST']." WHERE configuration_key = 'MODULE_BILLIGER_SHIPPING_METHOD'"); require DIR_FS_CATALOG . DIR_WS_CLASSES . 'xtcPrice.php'; $xtPrice = new xtcPrice($_POST['currencies'], $_POST['status']); // query //BOF - DokuMan - 2011-06-24 - fix sql query (thx to franky_n) /* $export_query = xtc_db_query("SELECT p.products_id, p.products_model, p.products_ean, p.products_image, p.products_price, p.products_status, p.products_date_available, p.products_shippingtime, p.products_discount_allowed, p.products_tax_class_id, p.products_date_added, p.products_weight, pd.products_name, pd.products_description, pd.products_short_description, pd.products_meta_keywords, m.manufacturers_name, lng.code FROM " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_MANUFACTURERS . " m ON p.manufacturers_id = m.manufacturers_id LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON p.products_id = pd.products_id LEFT JOIN " . TABLE_SPECIALS . " s ON p.products_id = s.products_id LEFT JOIN " . TABLE_LANGUAGES . " as lng ON lng.languages_id = '" . (int) $_POST['languages_id'] . "' WHERE p.products_status = 1 AND lng.languages_id = pd.language_id ORDER BY p.products_date_added DESC, pd.products_name"); */ $export_query = xtc_db_query("SELECT\n p.products_id,\n pd.products_name,\n pd.products_description,\n pd.products_short_description,\n p.products_model,\n p.products_ean,\n p.products_image,\n p.products_price,\n p.products_status,\n p.products_date_available,\n p.products_shippingtime,\n p.products_discount_allowed,\n pd.products_meta_keywords,\n p.products_tax_class_id,\n p.products_date_added,\n p.products_weight,\n m.manufacturers_name\n FROM\n " . TABLE_PRODUCTS . " p LEFT JOIN\n " . TABLE_MANUFACTURERS . " m\n ON p.manufacturers_id = m.manufacturers_id LEFT JOIN\n " . TABLE_PRODUCTS_DESCRIPTION . " pd\n ON p.products_id = pd.products_id AND\n pd.language_id = '" . (int) $_SESSION['languages_id'] . "' LEFT JOIN\n " . TABLE_SPECIALS . " s\n ON p.products_id = s.products_id\n WHERE\n p.products_status = 1\n ORDER BY\n p.products_date_added DESC,\n pd.products_name"); //BOF - DokuMan - 2011-06-24 - fix sql query (thx to franky_n) // csv schema / headline $schema = 'id;hersteller;modell_nr;name;kategorie;beschreibung;bild_klein;bild_gross;link;lieferzeit;lieferkosten;preis;waehrung;aufbauservice;24_Std_service;EAN;ASIN;ISBN;PZN;ISMN;EPC;VIN'; $schema .= "\n"; // parse data while ($products = xtc_db_fetch_array($export_query)) { $id = $products['products_id']; $hersteller = $products['manufacturers_name']; $modell_nr = ''; $name = $this->cleanVars($products['products_name']); $kategorie = $this->buildCAT($this->getCategoriesID($products['products_id'])); $beschreibung = substr($this->cleanVars($products['products_short_description']), 0, 255); $bild_klein = $products['products_image'] != '' ? HTTP_CATALOG_SERVER . DIR_WS_CATALOG_THUMBNAIL_IMAGES . $products['products_image'] : ''; $bild_gross = $products['products_image'] != '' ? HTTP_CATALOG_SERVER . DIR_WS_CATALOG_POPUP_IMAGES . $products['products_image'] : ''; $lang_param = $products['code'] != DEFAULT_LANGUAGE ? '&language=' . $products['code'] : ''; $link = xtc_catalog_href_link('product_info.php', xtc_product_link($products['products_id'], $products['products_name']) . (!empty($_POST['campaign']) ? '&' . $_POST['campaign'] : '')); $lieferzeit = $this->getShippingtimeName($products['products_shippingtime']); $lieferkosten = number_format($this->getShippingCost($products['products_price'], $products['products_weight']), 2, ',', ''); $preis = $xtPrice->xtcGetPrice($products['products_id'], $format = false, 1, $products['products_tax_class_id'], ''); $waehrung = $_POST['currencies']; $aufbauservice = ''; $x24_Std_service = ''; $EAN = $products['products_ean']; $ASIN = ''; $ISBN = ''; $PZN = ''; $ISMN = ''; $EPC = ''; $VIN = ''; // add line $schema .= $id . ";" . $hersteller . ";" . $modell_nr . ";" . $name . ";" . substr($kategorie, 0, strlen($kategorie) - 2) . ";" . $beschreibung . ";" . $bild_klein . ";" . $bild_gross . ";" . $link . ";" . $lieferzeit . ";" . $lieferkosten . ";" . number_format($preis, 2, ',', '') . ";" . $waehrung . ";" . $aufbauservice . ";" . $x24_Std_service . ";" . $EAN . ";" . $ASIN . ";" . $ISBN . ";" . $PZN . ";" . $ISMN . ";" . $EPC . ";" . $VIN . "" . "\n"; } $filename = DIR_FS_DOCUMENT_ROOT . 'export/' . $file; if ($_POST['export'] == 'yes') { $filename = $filename . '.tmp_' . time(); } // create File $fp = fopen($filename, "w+"); fputs($fp, $schema); fclose($fp); // send File to Browser switch ($_POST['export']) { case 'yes': header('Content-type: application/x-octet-stream'); header('Content-disposition: attachment; filename=' . $file); readfile($filename); unlink($filename); exit; break; } }