コード例 #1
0
ファイル: Servlet.php プロジェクト: xcgpseud/forum
 public function __construct()
 {
     session_start();
     $this->facade = MainFactory::createFacade();
     define('SERVLET', 1);
     //Set the user as online if they are logged in
     if (isset($_SESSION["user"])) {
         $this->facade->setOnline($_SESSION["user"]->getUsername());
         $this->isLoggedIn = true;
     }
     //Set up header / footer contents
     $this->headerContents = $this->facade->getHeaderContents();
     $this->footerContents = $this->facade->getFooterContents();
     //Get the home data to return
     $this->homeContents = $this->facade->getHomeContents();
     $this->onlineUsers = $this->facade->getOnlineUsers();
 }
コード例 #2
0
require_once DIR_FS_CATALOG . 'gm/inc/gm_is_valid_trusted_shop_id.inc.php';
require_once DIR_FS_CATALOG . 'gm/inc/gm_convert_qty.inc.php';
require_once DIR_FS_CATALOG . 'gm/inc/gm_create_corner.inc.php';
require_once DIR_FS_CATALOG . 'gm/inc/gm_get_privacy_link.inc.php';
if (is_dir(DIR_FS_CATALOG . 'StyleEdit/')) {
    require_once DIR_FS_CATALOG . 'StyleEdit/classes/GMSESecurity.php';
    require_once DIR_FS_CATALOG . 'StyleEdit/classes/GMCSSManager.php';
    require_once DIR_FS_CATALOG . 'StyleEdit/classes/GMBoxesMaster.php';
}
require_once DIR_FS_INC . 'xtc_Security.inc.php';
require_once DIR_WS_CLASSES . 'class.inputfilter.php';
MainFactory::create_object('FilterManager');
global $gmLangFileMaster;
$gmLangFileMaster = MainFactory::create_object('GMLangFileMaster');
global $gmSEOBoost;
$gmSEOBoost = MainFactory::create_object('GMSEOBoost');
function xtDBquery($query)
{
    if (DB_CACHE == 'true') {
        $result = xtc_db_queryCached($query);
    } else {
        $result = xtc_db_query($query);
    }
    return $result;
}
/**
 * Shopping cart class
 */
require_once DIR_WS_CLASSES . 'shopping_cart.php';
require_once DIR_WS_CLASSES . 'wish_list.php';
/**
コード例 #3
0
 function _process_order()
 {
     try {
         /**
          * Process the internal cartID to match the cartID in the $_SESSION 
          */
         if (isset($_SESSION['cart']->cartID) && isset($_SESSION['cartID'])) {
             if ($_SESSION['cart']->cartID != $_SESSION['cartID']) {
                 return false;
             }
         }
         $order = new order();
         /** 
          * PropertiesControl Object
          */
         $coo_properties = MainFactory::create_object('PropertiesControl');
         $tmp_status = $order->info['order_status'];
         if ($_SESSION['customers_status']['customers_status_ot_discount_flag'] == 1) {
             $discount = $_SESSION['customers_status']['customers_status_ot_discount'];
         } else {
             $discount = '0.00';
         }
         if (gm_get_conf("GM_SHOW_IP") == '1' && gm_get_conf("GM_LOG_IP") == '1') {
             $customers_ip = $_SESSION['user_info']['user_ip'];
         }
         $comments = '';
         if (trim((string) $this->_request->comment_client) != '') {
             $comments .= sprintf('Customer\'s Comment: %s', trim((string) $this->_request->comment_client) . "\n");
         }
         $comments .= sprintf('Rakuten Order No: %s', (string) $this->_request->order_no . "\n") . sprintf('Rakuten Client ID: %s', (string) $this->_request->client->client_id . "\n");
         $order->info['comments'] = $comments;
         $order->info['rakuten_order_no'] = (string) $this->_request->order_no;
         $billing_addr = $this->_request->client;
         $order->customer['email_address'] = (string) $billing_addr->email;
         $order->customer['firstname'] = $this->_escape_str_revert((string) $billing_addr->first_name);
         $order->customer['lastname'] = $this->_escape_str_revert((string) $billing_addr->last_name);
         $order->customer['telephone'] = (string) $billing_addr->phone;
         $billing_country_result = xtc_db_query("SELECT countries_id, countries_name from " . TABLE_COUNTRIES . " WHERE countries_iso_code_2 = '" . (string) $billing_addr->country . "' ");
         if (xtc_db_num_rows($billing_country_result)) {
             $billing_country = xtc_db_fetch_array($billing_country_result);
         } else {
             $billing_country['countries_id'] = -1;
             $billing_country['countries_name'] = (string) $billing_addr->country;
         }
         $order->billing['firstname'] = (string) $billing_addr->first_name;
         $order->billing['lastname'] = (string) $billing_addr->last_name;
         $order->billing['company'] = (string) $billing_addr->company;
         $order->billing['street_address'] = (string) $billing_addr->street . " " . (string) $billing_addr->street_no . ((string) $billing_addr->address_add ? '<br />' . (string) $billing_addr->address_add : '');
         $order->billing['city'] = (string) $billing_addr->city;
         $order->billing['postcode'] = (string) $billing_addr->zip_code;
         $order->billing['country']['title'] = $billing_country['countries_name'];
         $order->billing['country']['iso_code_2'] = (string) $billing_addr->country;
         $order->billing['format_id'] = '5';
         $shipping_addr = $this->_request->delivery_address;
         $shipping_country_result = xtc_db_query("SELECT countries_id, countries_name from " . TABLE_COUNTRIES . " WHERE countries_iso_code_2 = '" . (string) $shipping_addr->country . "' ");
         if (xtc_db_num_rows($shipping_country_result)) {
             $shipping_country = xtc_db_fetch_array($shipping_country_result);
         } else {
             $shipping_country['countries_id'] = -1;
             $shipping_country['countries_name'] = (string) $shipping_addr->country;
         }
         $order->delivery['firstname'] = (string) $shipping_addr->first_name;
         $order->delivery['lastname'] = (string) $shipping_addr->last_name;
         $order->delivery['company'] = (string) $shipping_addr->company;
         $order->delivery['street_address'] = (string) $shipping_addr->street . " " . (string) $shipping_addr->street_no . ((string) $shipping_addr->address_add ? '<br />' . (string) $shipping_addr->address_add : '');
         $order->delivery['city'] = (string) $shipping_addr->city;
         $order->delivery['postcode'] = (string) $shipping_addr->zip_code;
         $order->delivery['country']['title'] = $shipping_country['countries_name'];
         $order->delivery['country']['iso_code_2'] = (string) $shipping_addr->country;
         $order->delivery['format_id'] = '5';
         $order->info['payment_method'] = 'rakuten';
         $order->info['payment_class'] = '';
         $order->info['shipping_method'] = 'rakuten';
         $order->info['shipping_class'] = '';
         $sql_data_array = array('customers_id' => $_SESSION['customer_id'], 'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'], 'customers_firstname' => $order->customer['firstname'], 'customers_lastname' => $order->customer['lastname'], 'customers_cid' => $order->customer['csID'], 'customers_vat_id' => $_SESSION['customer_vat_id'], 'customers_company' => $order->customer['company'], 'customers_status' => $_SESSION['customers_status']['customers_status_id'], 'customers_status_name' => $_SESSION['customers_status']['customers_status_name'], 'customers_status_image' => $_SESSION['customers_status']['customers_status_image'], 'customers_status_discount' => $discount, 'customers_street_address' => $order->customer['street_address'], 'customers_suburb' => $order->customer['suburb'], 'customers_city' => $order->customer['city'], 'customers_postcode' => $order->customer['postcode'], 'customers_state' => $order->customer['state'], 'customers_country' => $order->customer['country']['title'], 'customers_telephone' => $order->customer['telephone'], 'customers_email_address' => $order->customer['email_address'], 'customers_address_format_id' => $order->customer['format_id'], 'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'], 'delivery_firstname' => $order->delivery['firstname'], 'delivery_lastname' => $order->delivery['lastname'], 'delivery_company' => $order->delivery['company'], 'delivery_street_address' => $order->delivery['street_address'], 'delivery_suburb' => $order->delivery['suburb'], 'delivery_city' => $order->delivery['city'], 'delivery_postcode' => $order->delivery['postcode'], 'delivery_state' => $order->delivery['state'], 'delivery_country' => $order->delivery['country']['title'], 'delivery_country_iso_code_2' => $order->delivery['country']['iso_code_2'], 'delivery_address_format_id' => $order->delivery['format_id'], 'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'], 'billing_firstname' => $order->billing['firstname'], 'billing_lastname' => $order->billing['lastname'], 'billing_company' => $order->billing['company'], 'billing_street_address' => $order->billing['street_address'], 'billing_suburb' => $order->billing['suburb'], 'billing_city' => $order->billing['city'], 'billing_postcode' => $order->billing['postcode'], 'billing_state' => $order->billing['state'], 'billing_country' => $order->billing['country']['title'], 'billing_country_iso_code_2' => $order->billing['country']['iso_code_2'], 'billing_address_format_id' => $order->billing['format_id'], 'payment_method' => $order->info['payment_method'], 'payment_class' => $order->info['payment_class'], 'shipping_method' => $order->info['shipping_method'], 'shipping_class' => $order->info['shipping_class'], 'cc_type' => $order->info['cc_type'], 'cc_owner' => $order->info['cc_owner'], 'cc_number' => $order->info['cc_number'], 'cc_expires' => $order->info['cc_expires'], 'cc_start' => $order->info['cc_start'], 'cc_cvv' => $order->info['cc_cvv'], 'cc_issue' => $order->info['cc_issue'], 'date_purchased' => 'now()', 'orders_status' => $tmp_status, 'currency' => $order->info['currency'], 'currency_value' => $order->info['currency_value'], 'customers_ip' => $customers_ip, 'language' => $_SESSION['language'], 'comments' => $order->info['comments'], 'rakuten_order_no' => $order->info['rakuten_order_no']);
         xtc_db_perform(TABLE_ORDERS, $sql_data_array);
         $insert_id = xtc_db_insert_id();
         $_SESSION['tmp_oID'] = $insert_id;
         $sql_data_array = array('orders_id' => $insert_id, 'title' => MODULE_PAYMENT_RAKUTEN_SUBTOTAL . ':', 'text' => ' ' . sprintf("%01.2f EUR", (double) $this->_request->total - (double) $this->_request->shipping - (double) $this->_request->total_tax_amount), 'value' => (double) $this->_request->total - (double) $this->_request->shipping - (double) $this->_request->total_tax_amount, 'class' => 'ot_subtotal', 'sort_order' => 10);
         xtc_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
         $sql_data_array = array('orders_id' => $insert_id, 'title' => MODULE_PAYMENT_RAKUTEN_SHIPPING . ':', 'text' => ' ' . sprintf("%01.2f EUR", (double) $this->_request->shipping), 'value' => (double) $this->_request->shipping, 'class' => 'ot_shipping', 'sort_order' => 30);
         xtc_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
         $sql_data_array = array('orders_id' => $insert_id, 'title' => MODULE_PAYMENT_RAKUTEN_TAX . ':', 'text' => ' ' . sprintf("%01.2f EUR", (double) $this->_request->total_tax_amount), 'value' => (double) $this->_request->total_tax_amount, 'class' => 'ot_tax', 'sort_order' => 97);
         xtc_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
         $sql_data_array = array('orders_id' => $insert_id, 'title' => MODULE_PAYMENT_RAKUTEN_TOTAL . ':', 'text' => sprintf("<b> %01.2f EUR</b>", (double) $this->_request->total), 'value' => (double) $this->_request->total, 'class' => 'ot_total', 'sort_order' => 99);
         xtc_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
         $customer_notification = '0';
         $sql_data_array = array('orders_id' => $insert_id, 'orders_status_id' => $order->info['order_status'], 'date_added' => 'now()', 'customer_notified' => $customer_notification, 'comments' => $order->info['comments']);
         xtc_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
         require_once DIR_FS_CATALOG . 'gm/inc/set_shipping_status.php';
         for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
             /**
              * Stock update
              */
             if (STOCK_LIMITED == 'true') {
                 if (DOWNLOAD_ENABLED == 'true') {
                     $stock_query_raw = "SELECT p.products_quantity, pad.products_attributes_filename\n                                                    FROM " . TABLE_PRODUCTS . " p\n                                                    LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa\n                                                     ON p.products_id=pa.products_id\n                                                    LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad\n                                                     ON pa.products_attributes_id=pad.products_attributes_id\n                                                    WHERE p.products_id = '" . xtc_get_prid($order->products[$i]['id']) . "'";
                     $products_attributes = $order->products[$i]['attributes'];
                     if (is_array($products_attributes)) {
                         $stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'";
                     }
                     $stock_query = xtc_db_query($stock_query_raw);
                 } else {
                     $stock_query = xtc_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . xtc_get_prid($order->products[$i]['id']) . "'");
                 }
                 if (xtc_db_num_rows($stock_query) > 0) {
                     $stock_values = xtc_db_fetch_array($stock_query);
                     /** 
                      * Do not decrement quantities if products_attributes_filename exists
                      */
                     if (DOWNLOAD_ENABLED != 'true' || !$stock_values['products_attributes_filename']) {
                         $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];
                     } else {
                         $stock_left = $stock_values['products_quantity'];
                     }
                     xtc_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . xtc_get_prid($order->products[$i]['id']) . "'");
                     if ($stock_left < 1 && STOCK_ALLOW_CHECKOUT == 'false' && GM_SET_OUT_OF_STOCK_PRODUCTS == 'true') {
                         xtc_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . xtc_get_prid($order->products[$i]['id']) . "'");
                     }
                     set_shipping_status($order->products[$i]['id']);
                     if ($stock_left <= STOCK_REORDER_LEVEL) {
                         $gm_get_products_name = xtc_db_query("SELECT products_name\n                                                                                            FROM products_description\n                                                                                            WHERE\n                                                                                                products_id = '" . xtc_get_prid($order->products[$i]['id']) . "'\n                                                                                                AND language_id = '" . $_SESSION['languages_id'] . "'");
                         $gm_stock_data = mysql_fetch_array($gm_get_products_name);
                         $gm_subject = GM_OUT_OF_STOCK_NOTIFY_TEXT . ' ' . $gm_stock_data['products_name'];
                         $gm_body = GM_OUT_OF_STOCK_NOTIFY_TEXT . ': ' . (double) $stock_left . "\n\n" . HTTP_SERVER . DIR_WS_CATALOG . 'product_info.php?info=p' . xtc_get_prid($order->products[$i]['id']);
                         /**
                          * Send the email
                          */
                         xtc_php_mail(STORE_OWNER_EMAIL_ADDRESS, STORE_NAME, STORE_OWNER_EMAIL_ADDRESS, STORE_NAME, '', STORE_OWNER_EMAIL_ADDRESS, STORE_NAME, '', '', $gm_subject, nl2br(htmlentities($gm_body)), $gm_body);
                     }
                 }
             }
             /**
              * Update products_ordered (for bestsellers list)
              */
             xtc_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . (double) $order->products[$i]['qty'] . " where products_id = '" . xtc_get_prid($order->products[$i]['id']) . "'");
             $sql_data_array = array('orders_id' => $insert_id, 'products_id' => xtc_get_prid($order->products[$i]['id']), 'products_model' => $order->products[$i]['model'], 'products_name' => $order->products[$i]['name'], 'products_shipping_time' => $order->products[$i]['shipping_time'], 'products_price' => $order->products[$i]['price'], 'final_price' => $order->products[$i]['final_price'], 'products_tax' => xtc_get_tax_rate($order->products[$i]['tax_class_id'], $shipping_country['countries_id']), 'products_discount_made' => $order->products[$i]['discount_allowed'], 'products_quantity' => $order->products[$i]['qty'], 'allow_tax' => $_SESSION['customers_status']['customers_status_show_price_tax']);
             xtc_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);
             $order_products_id = xtc_db_insert_id();
             if (!empty($order->products[$i]['quantity_unit_id'])) {
                 xtc_db_query("INSERT INTO orders_products_quantity_units\n                        SET orders_products_id = '" . (int) $order_products_id . "',\n                            quantity_unit_id = '" . (int) $order->products[$i]['quantity_unit_id'] . "',\n                            unit_name = '" . xtc_db_input($order->products[$i]['unit_name']) . "'");
             }
             /** 
              * Save selected properties_combi in product
              */
             $t_combis_id = $coo_properties->extract_combis_id($order->products[$i]['id']);
             $GLOBALS['coo_debugger']->log('checkout_process: $order->products[$i][id] ' . $order->products[$i]['id'], 'Properties');
             $GLOBALS['coo_debugger']->log('checkout_process: extract_combis_id ' . $t_combis_id, 'Properties');
             if (empty($t_combis_id) == false) {
                 $coo_properties->add_properties_combi_to_orders_product($t_combis_id, $order_products_id);
                 /**
                  * Update properties_combi quantity
                  */
                 $t_quantity_change = $order->products[$i]['qty'] * -1;
                 $val = $coo_properties->change_combis_quantity($t_combis_id, $t_quantity_change);
             }
             $specials_result = xtc_db_query("SELECT products_id, specials_quantity from " . TABLE_SPECIALS . " WHERE products_id = '" . xtc_get_prid($order->products[$i]['id']) . "' ");
             if (xtc_db_num_rows($specials_result)) {
                 $spq = xtc_db_fetch_array($specials_result);
                 $new_sp_quantity = $spq['specials_quantity'] - $order->products[$i]['qty'];
                 if ($new_sp_quantity >= 1) {
                     xtc_db_query("update " . TABLE_SPECIALS . " set specials_quantity = '" . $new_sp_quantity . "' where products_id = '" . xtc_get_prid($order->products[$i]['id']) . "' ");
                 } elseif (STOCK_CHECK == 'true') {
                     xtc_db_query("update " . TABLE_SPECIALS . " set status = '0', specials_quantity = '" . $new_sp_quantity . "' where products_id = '" . xtc_get_prid($order->products[$i]['id']) . "' ");
                 }
             }
             if (isset($order->products[$i]['attributes'])) {
                 $attributes_exist = '1';
                 for ($j = 0, $n2 = sizeof($order->products[$i]['attributes']); $j < $n2; $j++) {
                     if (DOWNLOAD_ENABLED == 'true') {
                         $attributes_query = "select popt.products_options_name,\n                                                               poval.products_options_values_name,\n                                                               pa.options_values_price,\n                                                               pa.price_prefix,\n                                                               pad.products_attributes_maxdays,\n                                                               pad.products_attributes_maxcount,\n                                                               pad.products_attributes_filename\n                                                               from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa\n                                                               left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad\n                                                                on pa.products_attributes_id=pad.products_attributes_id\n                                                               where pa.products_id = '" . $order->products[$i]['id'] . "'\n                                                                and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "'\n                                                                and pa.options_id = popt.products_options_id\n                                                                and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "'\n                                                                and pa.options_values_id = poval.products_options_values_id\n                                                                and popt.language_id = '" . $_SESSION['languages_id'] . "'\n                                                                and poval.language_id = '" . $_SESSION['languages_id'] . "'";
                         $attributes = xtc_db_query($attributes_query);
                     } else {
                         $attributes = xtc_db_query("select popt.products_options_name,\n                                                                             poval.products_options_values_name,\n                                                                             pa.options_values_price,\n                                                                             pa.price_prefix\n                                                                             from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa\n                                                                             where pa.products_id = '" . $order->products[$i]['id'] . "'\n                                                                             and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "'\n                                                                             and pa.options_id = popt.products_options_id\n                                                                             and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "'\n                                                                             and pa.options_values_id = poval.products_options_values_id\n                                                                             and popt.language_id = '" . $_SESSION['languages_id'] . "'\n                                                                             and poval.language_id = '" . $_SESSION['languages_id'] . "'");
                     }
                     /**
                      * update attribute stock
                      */
                     xtc_db_query("UPDATE " . TABLE_PRODUCTS_ATTRIBUTES . " set\n                                                       attributes_stock=attributes_stock - '" . $order->products[$i]['qty'] . "'\n                                                       where\n                                                       products_id='" . $order->products[$i]['id'] . "'\n                                                       and options_values_id='" . $order->products[$i]['attributes'][$j]['value_id'] . "'\n                                                       and options_id='" . $order->products[$i]['attributes'][$j]['option_id'] . "'\n                                                       ");
                     $attributes_values = xtc_db_fetch_array($attributes);
                     $sql_data_array = array('orders_id' => $insert_id, 'orders_products_id' => $order_products_id, 'products_options' => $attributes_values['products_options_name'], 'products_options_values' => $attributes_values['products_options_values_name'], 'options_values_price' => $attributes_values['options_values_price'], 'price_prefix' => $attributes_values['price_prefix']);
                     xtc_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);
                     if (DOWNLOAD_ENABLED == 'true' && isset($attributes_values['products_attributes_filename']) && xtc_not_null($attributes_values['products_attributes_filename'])) {
                         $sql_data_array = array('orders_id' => $insert_id, 'orders_products_id' => $order_products_id, 'orders_products_filename' => $attributes_values['products_attributes_filename'], 'download_maxdays' => $attributes_values['products_attributes_maxdays'], 'download_count' => $attributes_values['products_attributes_maxcount']);
                         xtc_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);
                     }
                     /**
                      * BOF GM_MOD attributes stock_notifier
                      */
                     $gm_get_attributes_stock = xtc_db_query("SELECT\n                                                                                                    pd.products_name,\n                                                                                                    pa.attributes_stock,\n                                                                                                    po.products_options_name,\n                                                                                                    pov.products_options_values_name\n                                                                                                FROM\n                                                                                                    products_description pd,\n                                                                                                    products_attributes pa,\n                                                                                                    products_options po,\n                                                                                                    products_options_values pov\n                                                                                                WHERE pa.products_id = '" . $order->products[$i]['id'] . "'\n                                                                   AND pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "'\n                                                                   AND pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "'\n                                                                                                 AND po.products_options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "'\n                                                                                                 AND po.language_id = '" . $_SESSION['languages_id'] . "'\n                                                                                                 AND pov.products_options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "'\n                                                                                                 AND pov.language_id = '" . $_SESSION['languages_id'] . "'\n                                                                                                 AND pd.products_id = '" . $order->products[$i]['id'] . "'\n                                                                                                 AND pd.language_id = '" . $_SESSION['languages_id'] . "'");
                     if (xtc_db_num_rows($gm_get_attributes_stock) == 1) {
                         $gm_attributes_stock_data = xtc_db_fetch_array($gm_get_attributes_stock);
                         if ($gm_attributes_stock_data['attributes_stock'] <= STOCK_REORDER_LEVEL) {
                             $gm_subject = GM_OUT_OF_STOCK_NOTIFY_TEXT . ' ' . $gm_attributes_stock_data['products_name'] . ' - ' . $gm_attributes_stock_data['products_options_name'] . ': ' . $gm_attributes_stock_data['products_options_values_name'];
                             $gm_body = GM_OUT_OF_STOCK_NOTIFY_TEXT . ': ' . (double) $gm_attributes_stock_data['attributes_stock'] . ' (' . $gm_attributes_stock_data['products_name'] . ' - ' . $gm_attributes_stock_data['products_options_name'] . ': ' . $gm_attributes_stock_data['products_options_values_name'] . ")\n\n" . HTTP_SERVER . DIR_WS_CATALOG . 'product_info.php?info=p' . xtc_get_prid($order->products[$i]['id']);
                             xtc_php_mail(STORE_OWNER_EMAIL_ADDRESS, STORE_NAME, STORE_OWNER_EMAIL_ADDRESS, STORE_NAME, '', STORE_OWNER_EMAIL_ADDRESS, STORE_NAME, '', '', $gm_subject, nl2br(htmlentities($gm_body)), $gm_body);
                         }
                     }
                 }
             }
             $total_weight += $order->products[$i]['qty'] * $order->products[$i]['weight'];
             $total_cost += $total_products_price;
         }
         if (isset($_SESSION['tracking']['refID'])) {
             xtc_db_query("update " . TABLE_ORDERS . " set\n                                     refferers_id = '" . $_SESSION['tracking']['refID'] . "'\n                                     where orders_id = '" . $insert_id . "'");
             /** 
              * Check if late or direct sale 
              */
             $customers_logon_query = "SELECT customers_info_number_of_logons\n                                            FROM " . TABLE_CUSTOMERS_INFO . "\n                                            WHERE customers_info_id  = '" . $_SESSION['customer_id'] . "'";
             $customers_logon_query = xtc_db_query($customers_logon_query);
             $customers_logon = xtc_db_fetch_array($customers_logon_query);
             if ($customers_logon['customers_info_number_of_logons'] == 0) {
                 /**
                  * direct sale
                  */
                 xtc_db_query("update " . TABLE_ORDERS . " set\n                                         conversion_type = '1'\n                                         where orders_id = '" . $insert_id . "'");
             } else {
                 /**
                  * late sale
                  */
                 xtc_db_query("update " . TABLE_ORDERS . " set\n                                         conversion_type = '2'\n                                         where orders_id = '" . $insert_id . "'");
             }
         } else {
             $customers_query = xtc_db_query("SELECT refferers_id as ref FROM " . TABLE_CUSTOMERS . " WHERE customers_id='" . $_SESSION['customer_id'] . "'");
             $customers_data = xtc_db_fetch_array($customers_query);
             if (xtc_db_num_rows($customers_query)) {
                 xtc_db_query("update " . TABLE_ORDERS . " set\n                                         refferers_id = '" . $customers_data['ref'] . "'\n                                         where orders_id = '" . $insert_id . "'");
                 /** 
                  * check if late or direct sale
                  */
                 $customers_logon_query = "SELECT customers_info_number_of_logons\n                                                FROM " . TABLE_CUSTOMERS_INFO . "\n                                                WHERE customers_info_id  = '" . $_SESSION['customer_id'] . "'";
                 $customers_logon_query = xtc_db_query($customers_logon_query);
                 $customers_logon = xtc_db_fetch_array($customers_logon_query);
                 if ($customers_logon['customers_info_number_of_logons'] == 0) {
                     /**
                      * Direct sale
                      */
                     xtc_db_query("update " . TABLE_ORDERS . " set\n                                             conversion_type = '1'\n                                             where orders_id = '" . $insert_id . "'");
                 } else {
                     /**
                      * Late sale
                      */
                     xtc_db_query("update " . TABLE_ORDERS . " set\n                                             conversion_type = '2'\n                                             where orders_id = '" . $insert_id . "'");
                 }
             }
         }
         $_SESSION['cart']->reset(true);
         /**
          * Unregister session variables used during checkout
          */
         unset($_SESSION['sendto']);
         unset($_SESSION['billto']);
         unset($_SESSION['shipping']);
         unset($_SESSION['payment']);
         unset($_SESSION['comments']);
         unset($_SESSION['last_order']);
         unset($_SESSION['tmp_oID']);
         unset($_SESSION['cc']);
         unset($_SESSION['nvpReqArray']);
         unset($_SESSION['reshash']);
         $last_order = $insert_id;
         if (isset($_SESSION['credit_covers'])) {
             unset($_SESSION['credit_covers']);
         }
     } catch (Exception $e) {
         throw $e;
     }
     return true;
 }
コード例 #4
0
 *       names of its contributors may be used to endorse or promote products
 *       derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RAKUTEN DEUTSCHLAND GMBH BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
include 'includes/application_top.php';
/** 
 * @var $rakuten_checkout rakuten_checkout 
 **/
$rakuten_checkout = MainFactory::create_object('rakuten_checkout');
/** 
 * minimum/maximum order value
 */
if ($_SESSION['cart']->show_total() > 0) {
    if ($_SESSION['cart']->show_total() < $_SESSION['customers_status']['customers_status_min_order']) {
        $_SESSION['allow_checkout'] = 'false';
    }
    if ($_SESSION['customers_status']['customers_status_max_order'] != 0) {
        if ($_SESSION['cart']->show_total() > $_SESSION['customers_status']['customers_status_max_order']) {
            $_SESSION['allow_checkout'] = 'false';
        }
    }
}
/**
 * Check if checkout is allowed
$smarty->assign('SHIPPING_ADDRESS_EDIT', xtc_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL'));
$smarty->assign('BILLING_ADDRESS_EDIT', xtc_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL'));
if ($_SESSION['sendto'] != false) {
    if ($order->info['shipping_method']) {
        $smarty->assign('SHIPPING_METHOD', $order->info['shipping_method']);
        $smarty->assign('SHIPPING_EDIT', xtc_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
    }
}
if (sizeof($order->info['tax_groups']) > 1) {
    if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 0 && $_SESSION['customers_status']['customers_status_add_tax_ot'] == 1) {
    }
} else {
}
// BOF GM_MOD
$coo_properties_control = MainFactory::create_object('PropertiesControl');
$coo_properties_view = MainFactory::create_object('PropertiesView');
$t_products_array = array();
$data_products = '<table id="table_products_data" border="0" cellspacing="0" cellpadding="0">';
for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
    $t_products_item = array('products_name' => '', 'quantity' => '', 'final_price' => '', 'shipping_status' => '', 'attributes' => '', 'flag_last_item' => false, 'PROPERTIES' => '');
    $t_products_attributes = array();
    #properties
    $t_combis_id = $coo_properties_control->extract_combis_id($order->products[$i]['id']);
    if ($t_combis_id != '') {
        $t_products_item['PROPERTIES'] = $coo_properties_view->get_order_details_by_combis_id($t_combis_id, 'cart');
    }
    if (ACTIVATE_SHIPPING_STATUS == 'true') {
        $t_products_item['shipping_status'] = SHIPPING_TIME . $order->products[$i]['shipping_time'];
        $gm_shipping_status = ' <nobr><span class="shipping_time">(' . $t_products_item['shipping_status'] . ')</span><nobr>';
    } else {
        $gm_shipping_status = '';
コード例 #6
0
<?php

/* --------------------------------------------------------------
  PDFOrderExtenderComponent.inc.php 2012-05 gm
  Gambio GmbH
  http://www.gambio.de
  Copyright (c) 2012 Gambio GmbH
  Released under the GNU General Public License (Version 2)
  [http://www.gnu.org/licenses/gpl-2.0.html]
  --------------------------------------------------------------
 */
MainFactory::load_class('ExtenderComponent');
class PDFOrderExtenderComponent extends ExtenderComponent
{
    function extendOrderRight($order_right)
    {
        return $order_right;
    }
    function extendOrderData($order_data)
    {
        return $order_data;
    }
    function extendOrderTotal($order_total)
    {
        return $order_total;
    }
    function extendOrderInfo($order_info)
    {
        return $order_info;
    }
    function extendPdfFooter($pdf_footer)
コード例 #7
0
ファイル: index.php プロジェクト: xcgpseud/forum
<?php

require_once 'php/controllers/Servlet.php';
$servlet = MainFactory::createServlet();
$servlet->processRequest();
コード例 #8
0
   modified eCommerce Shopsoftware
   http://www.modified-shop.org

   Copyright (c) 2009 - 2014 [www.modified-shop.org]
   -----------------------------------------------------------------------------------------
   Released under the GNU General Public License
   -----------------------------------------------------------------------------------------
   
   @modified_by Easymarketing AG, Florian Ressel <*****@*****.**>

   @file       admin/easymarketing.php
   @version    01.10.2014 - 15:34
   ---------------------------------------------------------------------------------------*/
require 'includes/application_top.php';
$coo_easymarketing_manager = MainFactory::create_object('Easymarketing');
if (isset($_GET['content']) && $_GET['content'] != '') {
    switch ($_GET['content']) {
        case 'install':
            if ($coo_easymarketing_manager->check() == false) {
                $coo_easymarketing_manager->install();
            }
            xtc_redirect(xtc_href_link('easymarketing.php', 'content=settings'));
            break;
        case 'uninstall':
            if ($coo_easymarketing_manager->check() == true) {
                $coo_easymarketing_manager->uninstall();
            }
            xtc_redirect(xtc_href_link('easymarketing.php'));
            break;
        case 'stop_uninstall':
 function get_html($p_products_array)
 {
     $coo_properties_control = MainFactory::create_object('PropertiesControl');
     $coo_properties_view = MainFactory::create_object('PropertiesView');
     $t_content_array = array();
     $module_content = array();
     $any_out_of_stock = '';
     $mark_stock = '';
     $coo_seo_boost = MainFactory::create_object('GMSEOBoost');
     $coo_main = new main();
     $xtPrice = new xtcPrice($_SESSION['currency'], $_SESSION['customers_status']['customers_status_id']);
     for ($i = 0, $n = sizeof($p_products_array); $i < $n; $i++) {
         $t_combis_id = $coo_properties_control->extract_combis_id($p_products_array[$i]['id']);
         // check if combis_id is empty
         if ($t_combis_id == '') {
             // combis_id is empty = article without properties
             if (STOCK_CHECK == 'true') {
                 $mark_stock = xtc_check_stock($p_products_array[$i]['id'], $p_products_array[$i]['quantity']);
                 if ($mark_stock) {
                     $_SESSION['any_out_of_stock'] = 1;
                 }
             }
         }
         $image = '';
         if ($p_products_array[$i]['image'] != '') {
             $image = DIR_WS_THUMBNAIL_IMAGES . $p_products_array[$i]['image'];
         }
         //bof gm
         $gm_products_id = $p_products_array[$i]['id'];
         $gm_products_id = str_replace('{', '_', $gm_products_id);
         $gm_products_id = str_replace('}', '_', $gm_products_id);
         $gm_query = xtc_db_query("SELECT gm_show_weight FROM products WHERE products_id='" . $p_products_array[$i]['id'] . "'");
         $gm_array = xtc_db_fetch_array($gm_query);
         if (empty($gm_array['gm_show_weight'])) {
             $p_products_array[$i]['gm_weight'] = 0;
         }
         $gm_product_link = xtc_href_link(FILENAME_PRODUCT_INFO, xtc_product_link($p_products_array[$i]['id'], $p_products_array[$i]['name']) . '&no_boost=1');
         include DIR_FS_CATALOG . 'gm/modules/gm_gprint_order_details_cart.php';
         $t_shipping_time = $p_products_array[$i]['shipping_time'];
         $t_products_weight = $p_products_array[$i]['gm_weight'];
         $t_products_model = $p_products_array[$i]['model'];
         #properties
         if ($t_combis_id != '') {
             $t_properties_html = $coo_properties_view->get_order_details_by_combis_id($t_combis_id, 'cart');
             $coo_products = MainFactory::create_object('GMDataObject', array('products', array('products_id' => $p_products_array[$i]['id'])));
             $use_properties_combis_quantity = $coo_products->get_data_value('use_properties_combis_quantity');
             if ($use_properties_combis_quantity == 1) {
                 // check article quantity
                 $mark_stock = xtc_check_stock($p_products_array[$i]['id'], $p_products_array[$i]['quantity']);
                 if ($mark_stock) {
                     $_SESSION['any_out_of_stock'] = 1;
                 }
             } else {
                 if ($use_properties_combis_quantity == 0 && ATTRIBUTE_STOCK_CHECK == 'true' && STOCK_CHECK == 'true' || $use_properties_combis_quantity == 2) {
                     // check combis quantity
                     $t_properties_stock = $coo_properties_control->get_properties_combis_quantity($t_combis_id);
                     if ($t_properties_stock < $p_products_array[$i]['quantity']) {
                         $_SESSION['any_out_of_stock'] = 1;
                         $mark_stock = '<span class="markProductOutOfStock">' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . '</span>';
                     }
                 }
             }
             $t_weight = $coo_properties_control->get_properties_combis_weight($t_combis_id);
             if ($coo_products->get_data_value('use_properties_combis_weight') == 1) {
                 $t_products_weight = gm_prepare_number($t_weight, $xtPrice->currencies[$xtPrice->actualCurr]['decimal_point']);
             } else {
                 $t_products_weight = gm_prepare_number($t_weight + $p_products_array[$i]['weight'], $xtPrice->currencies[$xtPrice->actualCurr]['decimal_point']);
             }
             if ($coo_products->get_data_value('use_properties_combis_shipping_time') == 1) {
                 $t_shipping_time = $coo_properties_control->get_properties_combis_shipping_time($t_combis_id);
             }
             $t_combi_model = $coo_properties_control->get_properties_combis_model($t_combis_id);
             if (APPEND_PROPERTIES_MODEL == "true") {
                 // Artikelnummer (Kombi) an Artikelnummer (Artikel) anhängen
                 if ($t_products_model != '' && $t_combi_model != '') {
                     $t_products_model = $t_products_model . '-' . $t_combi_model;
                 } else {
                     if ($t_combi_model != '') {
                         $t_products_model = $t_combi_model;
                     }
                 }
             } else {
                 // Artikelnummer (Artikel) durch Artikelnummer (Kombi) ersetzen
                 if ($t_combi_model != '') {
                     $t_products_model = $t_combi_model;
                 }
             }
         } else {
             $t_properties_html = '';
         }
         $module_content[$i] = array('PRODUCTS_NAME' => $p_products_array[$i]['name'] . $mark_stock, 'PRODUCTS_QTY' => xtc_draw_input_field('cart_quantity[]', gm_convert_qty($p_products_array[$i]['quantity'], false), ' size="2" onblur="gm_qty_is_changed(' . $p_products_array[$i]['quantity'] . ', this.value, \'' . GM_QTY_CHANGED_MESSAGE . '\')"', 'text', true, "gm_cart_data gm_class_input") . xtc_draw_hidden_field('products_id[]', $p_products_array[$i]['id'], 'class="gm_cart_data"') . xtc_draw_hidden_field('old_qty[]', $p_products_array[$i]['quantity']), 'PRODUCTS_OLDQTY_INPUT_NAME' => 'old_qty[]', 'PRODUCTS_QTY_INPUT_NAME' => 'cart_quantity[]', 'PRODUCTS_QTY_VALUE' => gm_convert_qty($p_products_array[$i]['quantity'], false), 'PRODUCTS_ID_INPUT_NAME' => 'products_id[]', 'PRODUCTS_ID_EXTENDED' => $p_products_array[$i]['id'], 'PRODUCTS_MODEL' => $t_products_model, 'SHOW_PRODUCTS_MODEL' => SHOW_PRODUCTS_MODEL, 'PRODUCTS_SHIPPING_TIME' => $t_shipping_time, 'PRODUCTS_TAX' => (double) $p_products_array[$i]['tax'], 'PRODUCTS_IMAGE' => $image, 'IMAGE_ALT' => $p_products_array[$i]['name'], 'BOX_DELETE' => xtc_draw_checkbox_field('cart_delete[]', $p_products_array[$i]['id'], false, 'id="gm_delete_product_' . $gm_products_id . '"'), 'PRODUCTS_LINK' => $gm_product_link, 'PRODUCTS_PRICE' => $xtPrice->xtcFormat($p_products_array[$i]['price'] * $p_products_array[$i]['quantity'], true), 'PRODUCTS_SINGLE_PRICE' => $xtPrice->xtcFormat($p_products_array[$i]['price'], true), 'PRODUCTS_SHORT_DESCRIPTION' => xtc_get_short_description($p_products_array[$i]['id']), 'ATTRIBUTES' => '', 'PROPERTIES' => $t_properties_html, 'GM_WEIGHT' => $t_products_weight, 'PRODUCTS_ID' => $gm_products_id, 'UNIT' => $p_products_array[$i]['unit_name']);
         //eof gm
         // Product options names
         $attributes_exist = isset($p_products_array[$i]['attributes']) ? 1 : 0;
         if ($attributes_exist == 1) {
             reset($p_products_array[$i]['attributes']);
             while (list($option, $value) = each($p_products_array[$i]['attributes'])) {
                 if (ATTRIBUTE_STOCK_CHECK == 'true' && STOCK_CHECK == 'true' && $value != 0) {
                     $attribute_stock_check = xtc_check_stock_attributes($p_products_array[$i][$option]['products_attributes_id'], $p_products_array[$i]['quantity']);
                     if ($attribute_stock_check) {
                         $_SESSION['any_out_of_stock'] = 1;
                     }
                 }
                 $module_content[$i]['ATTRIBUTES'][] = array('ID' => $p_products_array[$i][$option]['products_attributes_id'], 'MODEL' => xtc_get_attributes_model(xtc_get_prid($p_products_array[$i]['id']), $p_products_array[$i][$option]['products_options_values_name'], $p_products_array[$i][$option]['products_options_name']), 'NAME' => $p_products_array[$i][$option]['products_options_name'], 'VALUE_NAME' => $p_products_array[$i][$option]['products_options_values_name'] . $attribute_stock_check);
                 // BOF GM_MOD GX-Customizer:
                 require DIR_FS_CATALOG . 'gm/modules/gm_gprint_order_details_cart_2.php';
             }
         }
     }
     $total_content = '';
     $total = $_SESSION['cart']->show_total();
     if ($_SESSION['customers_status']['customers_status_ot_discount_flag'] == '1' && $_SESSION['customers_status']['customers_status_ot_discount'] != '0.00') {
         if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 0 && $_SESSION['customers_status']['customers_status_add_tax_ot'] == 1) {
             $price = $total - $_SESSION['cart']->show_tax(false);
         } else {
             $price = $total;
         }
         // BOF GM_MOD
         $discount = round($xtPrice->xtcGetDC($price, $_SESSION['customers_status']['customers_status_ot_discount']), 2);
         $total_content = $_SESSION['customers_status']['customers_status_ot_discount'] . ' % ' . SUB_TITLE_OT_DISCOUNT . ' -' . xtc_format_price($discount, $price_special = 1, $calculate_currencies = false) . '<br />';
         $this->set_content_data('DISCOUNT_TEXT', round((double) $_SESSION['customers_status']['customers_status_ot_discount'], 2) . '% ' . SUB_TITLE_OT_DISCOUNT);
         $this->set_content_data('DISCOUNT_VALUE', '-' . xtc_format_price($discount, $price_special = 1, $calculate_currencies = false));
     }
     if ($_SESSION['customers_status']['customers_status_show_price'] == '1') {
         if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 0 && $_SESSION['customers_status']['customers_status_add_tax_ot'] == 0) {
             $total -= $discount;
         }
         if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 0 && $_SESSION['customers_status']['customers_status_add_tax_ot'] == 1) {
             $total -= $discount;
         }
         if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 1) {
             $total -= $discount;
         }
         $total_content .= SUB_TITLE_SUB_TOTAL . $xtPrice->xtcFormat($total, true) . '<br />';
         $t_total = $xtPrice->xtcFormat($total + $discount, true);
     } else {
         $total_content .= NOT_ALLOWED_TO_SEE_PRICES . '<br />';
     }
     // display only if there is an ot_discount
     if ($customer_status_value['customers_status_ot_discount'] != 0) {
         $total_content .= TEXT_CART_OT_DISCOUNT . $customer_status_value['customers_status_ot_discount'] . '%';
     }
     if (SHOW_SHIPPING == 'true') {
         $this->set_content_data('SHIPPING_INFO', ' ' . SHIPPING_EXCL . '<a href="' . $coo_main->gm_get_shipping_link(true) . '" target="_blank" class="lightbox_iframe"> ' . SHIPPING_COSTS . '</a>');
     }
     if ($_SESSION['customers_status']['customers_status_show_price'] == '1') {
         $gm_cart_tax_info = '';
         if (gm_get_conf('TAX_INFO_TAX_FREE') == 'true') {
             $gm_cart_tax_info = GM_TAX_FREE . '<br />';
             $this->set_content_data('TAX_FREE_TEXT', GM_TAX_FREE);
         } else {
             $gm_cart_tax_info = $_SESSION['cart']->show_tax();
             if (!empty($gm_cart_tax_info) && $_SESSION['customers_status']['customers_status_show_price_tax'] == '0' && $_SESSION['customers_status']['customers_status_add_tax_ot'] == '1') {
                 if (!defined(MODULE_ORDER_TOTAL_SUBTOTAL_TITLE_NO_TAX)) {
                     include_once DIR_FS_CATALOG . 'lang/' . $_SESSION['language'] . '/modules/order_total/ot_subtotal.php';
                 }
                 $t_gm_tax = 0;
                 foreach ($_SESSION['cart']->tax as $t_gm_key => $t_gm_value) {
                     $t_gm_tax += $t_gm_value['value'];
                 }
                 $gm_cart_tax_info = MODULE_ORDER_TOTAL_SUBTOTAL_TITLE_NO_TAX . ': ' . $xtPrice->xtcFormat((double) $total - (double) $t_gm_tax, true) . '<br />' . $gm_cart_tax_info;
                 $t_total = $xtPrice->xtcFormat((double) $total - (double) $t_gm_tax + $discount, true);
             }
         }
         $this->set_content_data('UST_CONTENT', $gm_cart_tax_info, 1);
     }
     $t_taxes_data_array = explode('<br />', $_SESSION['cart']->show_tax(true));
     $t_tax_array = array();
     for ($i = 0; $i < count($t_taxes_data_array); $i++) {
         if (!empty($t_taxes_data_array[$i])) {
             $t_tax_data_array = explode(':', $t_taxes_data_array[$i]);
             $t_tax_array[] = array('TEXT' => $t_tax_data_array[0], 'VALUE' => $t_tax_data_array[1]);
         }
     }
     $this->set_content_data('tax_data', $t_tax_array);
     $this->set_content_data('SUBTOTAL', $t_total);
     $this->set_content_data('TOTAL', $xtPrice->xtcFormat($total, true));
     $this->set_content_data('TOTAL_CONTENT', $total_content, 1);
     $this->set_content_data('language', $_SESSION['language']);
     $this->set_content_data('module_content', $module_content);
     $coo_gift_cart = MainFactory::create_object('GiftCartContentView');
     $t_view_html = $coo_gift_cart->get_html();
     $this->set_content_data('MODULE_gift_cart', $t_view_html);
     // Bitcoin Payment - Commerce Coding - BEGIN
     $multiplier = 1;
     $digits = 8;
     switch (MODULE_PAYMENT_BITCOIN_UNITS) {
         case 'uBTC':
             $multiplier *= 1000;
             $digits -= 3;
         case 'mBTC':
             $multiplier *= 1000;
             $digits -= 3;
         case 'BTC':
             $btcPrice = number_format($total / MODULE_PAYMENT_BITCOIN_BTCEUR * $multiplier, $digits, '.', '');
             $this->set_content_data('BITCOIN_PRICE', $btcPrice . ' ' . MODULE_PAYMENT_BITCOIN_UNITS);
     }
     // Bitcoin Payment - Commerce Coding - END
     $t_html_output = $this->build_html();
     return $t_html_output;
 }
コード例 #10
0
function mod_get_description($product_descriptions)
{
    $t_description = 'null';
    if (!defined('MODULE_EM_PRODUCTS_DESCRIPTION_DEFAULT')) {
        define('MODULE_EM_PRODUCTS_DESCRIPTION_DEFAULT', 'products_description');
    }
    if (!mod_is_empty($product_descriptions[MODULE_EM_PRODUCTS_DESCRIPTION_DEFAULT])) {
        if (MODULE_EM_PRODUCTS_DESCRIPTION_DEFAULT == 'products_description') {
            $gmTabTokenizer = MainFactory::create_object('GMTabTokenizer', array(stripslashes($product_descriptions['products_description'])));
            if ($gmTabTokenizer->get_tabs_count() > 0) {
                $t_description = $gmTabTokenizer->panel_content[0];
            } else {
                $t_description = $product_descriptions['products_description'];
            }
        } elseif (MODULE_EM_PRODUCTS_DESCRIPTION_DEFAULT == 'products_short_description') {
            $t_description = $product_descriptions['products_short_description'];
        }
    } else {
        if (MODULE_EM_PRODUCTS_DESCRIPTION_DEFAULT == 'products_description' && !mod_is_empty($products['products_short_description'])) {
            $t_description = $product_descriptions['products_short_description'];
        } elseif (MODULE_EM_PRODUCTS_DESCRIPTION_DEFAULT == 'products_short_description' && !mod_is_empty($product_descriptions['products_description'])) {
            $gmTabTokenizer = MainFactory::create_object('GMTabTokenizer', array(stripslashes($product_descriptions['products_description'])));
            if ($gmTabTokenizer->get_tabs_count() > 0) {
                $t_description = $gmTabTokenizer->panel_content[0];
            } else {
                $t_description = $product_descriptions['products_description'];
            }
        }
    }
    return trim($t_description);
}
コード例 #11
0
    $gm_pdf_use_protection = true;
}
if (gm_get_conf('GM_PDF_ALLOW_COPYING') == '0') {
    unset($gm_pdf_protection[3]);
    $gm_pdf_use_protection = true;
}
/*
 * -> get default values for class gmPDF
 */
$gm_pdf_values = gm_get_conf(array('GM_PDF_TOP_MARGIN', 'GM_PDF_LEFT_MARGIN', 'GM_PDF_RIGHT_MARGIN', 'GM_PDF_BOTTOM_MARGIN', 'GM_PDF_FIX_HEADER', 'GM_PDF_USE_HEADER', 'GM_PDF_USE_FOOTER', 'GM_PDF_DISPLAY_ZOOM', 'GM_PDF_DISPLAY_LAYOUT', 'GM_PDF_CELL_HEIGHT'));
$gm_pdf_values['GM_PDF_USE_PROTECTION'] = $gm_pdf_use_protection;
$gm_pdf_values['GM_PDF_USE_FOOTER'] = $use_footer;
/*
 * Extender
 */
$coo_pdforder_extender_component = MainFactory::create_object('PDFOrderExtenderComponent');
$coo_pdforder_extender_component->set_data('order', $order);
$coo_pdforder_extender_component->set_data('order_id', $_GET['oID']);
$coo_pdforder_extender_component->set_data('type', $_GET['type']);
$order_right = $coo_pdforder_extender_component->extendOrderRight($order_right);
$order_data = $coo_pdforder_extender_component->extendOrderData($order_data);
$order_total = $coo_pdforder_extender_component->extendOrderTotal($order_total);
$order_info = $coo_pdforder_extender_component->extendOrderInfo($order_info);
$pdf_footer = $coo_pdforder_extender_component->extendPdfFooter($pdf_footer);
$pdf_fonts = $coo_pdforder_extender_component->extendPdfFonts($pdf_fonts);
$gm_pdf_values = $coo_pdforder_extender_component->extendGmPdfValues($gm_pdf_values);
$gm_order_pdf_values = $coo_pdforder_extender_component->extendGmOrderPdfValues($gm_order_pdf_values);
$gm_use_products_model = $coo_pdforder_extender_component->extendGmUseProductsModel($gm_use_products_model);
/*
 * -> create pdf
 */
 function get_html($p_coo_product, $p_current_category_id = 0)
 {
     $t_html_output = '';
     $xtPrice = new xtcPrice($_SESSION['currency'], $_SESSION['customers_status']['customers_status_id']);
     $main = new main();
     $group_check = '';
     // xs:booster start (v1.041)
     $xsb_tx = array();
     if (@is_array($_SESSION['xtb0']['tx'])) {
         foreach ($_SESSION['xtb0']['tx'] as $tx) {
             if ($tx['products_id'] == $p_coo_product->data['products_id']) {
                 $xsb_tx = $tx;
                 break;
             }
         }
     }
     // xs:booster end
     if (!is_object($p_coo_product) || !$p_coo_product->isProduct()) {
         // product not found in database
         $error = TEXT_PRODUCT_NOT_FOUND;
         include DIR_WS_MODULES . FILENAME_ERROR_HANDLER;
         $t_html_output = $main_content;
     } else {
         if (ACTIVATE_NAVIGATOR == 'true') {
             $coo_product_navigator = MainFactory::create_object('ProductNavigatorContentView');
             $t_view_html = $coo_product_navigator->get_html($p_coo_product, $p_current_category_id);
             $this->set_content_data('PRODUCT_NAVIGATOR', $t_view_html);
         }
         xtc_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . $p_coo_product->data['products_id'] . "' and language_id = '" . $_SESSION['languages_id'] . "'");
         $products_price = $xtPrice->xtcGetPrice($p_coo_product->data['products_id'], $format = true, 1, $p_coo_product->data['products_tax_class_id'], $p_coo_product->data['products_price'], 1);
         // check if customer is allowed to add to cart
         // BOF GM_MOD:
         if ($_SESSION['customers_status']['customers_status_show_price'] != '0' && $xtPrice->gm_check_price_status($p_coo_product->data['products_id']) == 0) {
             // fsk18
             if ($_SESSION['customers_status']['customers_fsk18'] == '1') {
                 if ($p_coo_product->data['products_fsk18'] == '0') {
                     // BOF GM_MOD:
                     $this->set_content_data('ADD_QTY', xtc_draw_input_field('products_qty', gm_convert_qty($p_coo_product->data['gm_min_order'], false), 'id="gm_attr_calc_qty"') . ' ' . xtc_draw_hidden_field('products_id', $p_coo_product->data['products_id'], 'id="gm_products_id"'));
                     $t_quantity = gm_convert_qty($p_coo_product->data['gm_min_order'], false);
                     $t_disabled_quantity = 0;
                     if (@$xsb_tx['XTB_ALLOW_USER_CHQTY'] == 'true' || $xsb_tx['products_id'] != $p_coo_product->data['products_id']) {
                         $this->set_content_data('ADD_QTY', xtc_draw_input_field('products_qty', str_replace('.', ',', (double) $p_coo_product->data['gm_min_order']), 'id="gm_attr_calc_qty"') . ' ' . xtc_draw_hidden_field('products_id', $p_coo_product->data['products_id'], 'id="gm_products_id"'));
                     } else {
                         $this->set_content_data('ADD_QTY', xtc_draw_input_field('products_qty', '1', 'disabled="disabled" style="background-color:gray;"') . ' ' . xtc_draw_hidden_field('products_id', $p_coo_product->data['products_id'], 'id="gm_attr_calc_qty"'));
                         $t_quantity = 1;
                         $t_disabled_quantity = 1;
                     }
                     $this->set_content_data('QUANTITY', $t_quantity);
                     $this->set_content_data('DISABLED_QUANTITY', $t_disabled_quantity);
                     $this->set_content_data('ADD_CART_BUTTON', xtc_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART, 'id="cart_button"'));
                     if (gm_get_conf('GM_SHOW_WISHLIST') == 'true') {
                         $this->set_content_data('ADD_WISHLIST_BUTTON', '<a href="javascript:submit_to_wishlist()" id="gm_wishlist_link">' . xtc_image_button('button_in_wishlist.gif', NC_WISHLIST) . '</a>');
                     }
                 } else {
                     $this->set_content_data('GM_PID', xtc_draw_hidden_field('products_id', $p_coo_product->data['products_id'], 'id="gm_products_id"'));
                 }
             } else {
                 // BOF GM_MOD:
                 $this->set_content_data('ADD_QTY', xtc_draw_input_field('products_qty', gm_convert_qty($p_coo_product->data['gm_min_order'], false), 'id="gm_attr_calc_qty"') . ' ' . xtc_draw_hidden_field('products_id', $p_coo_product->data['products_id'], 'id="gm_products_id"'));
                 $t_quantity = gm_convert_qty($p_coo_product->data['gm_min_order'], false);
                 $t_disabled_quantity = 0;
                 if (@$xsb_tx['XTB_ALLOW_USER_CHQTY'] == 'true' || $xsb_tx['products_id'] != $p_coo_product->data['products_id']) {
                     $this->set_content_data('ADD_QTY', xtc_draw_input_field('products_qty', str_replace('.', ',', (double) $p_coo_product->data['gm_min_order']), 'id="gm_attr_calc_qty"') . ' ' . xtc_draw_hidden_field('products_id', $p_coo_product->data['products_id'], 'id="gm_products_id"'));
                 } else {
                     $this->set_content_data('ADD_QTY', xtc_draw_input_field('products_qty', '1', 'disabled="disabled" style="background-color:gray;"') . ' ' . xtc_draw_hidden_field('products_id', $p_coo_product->data['products_id'], 'id="gm_attr_calc_qty"'));
                     $t_quantity = 1;
                     $t_disabled_quantity = 1;
                 }
                 $this->set_content_data('QUANTITY', $t_quantity);
                 $this->set_content_data('DISABLED_QUANTITY', $t_disabled_quantity);
                 $this->set_content_data('ADD_CART_BUTTON', xtc_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART, 'id="cart_button"'));
                 if (gm_get_conf('GM_SHOW_WISH_LIST') == 'true') {
                     $this->set_content_data('ADD_WISHLIST_BUTTON', '<a href="javascript:submit_to_wishlist()">' . xtc_image_button('button_in_wishlist.gif', NC_WISHLIST) . '</a>');
                 }
             }
         } elseif ($xtPrice->gm_check_price_status($p_coo_product->data['products_id']) > 0 || $_SESSION['customers_status']['customers_status_show_price'] == '0') {
             $this->set_content_data('GM_PID', xtc_draw_hidden_field('products_id', $p_coo_product->data['products_id'], 'id="gm_products_id"'));
         }
         if ($p_coo_product->data['products_fsk18'] == '1') {
             $this->set_content_data('PRODUCTS_FSK18', 'true');
         }
         // BOF GM_MOD:
         if (ACTIVATE_SHIPPING_STATUS == 'true' && $xtPrice->gm_check_price_status($p_coo_product->data['products_id']) == 0) {
             $this->set_content_data('SHIPPING_NAME', $main->getShippingStatusName($p_coo_product->data['products_shippingtime']));
             $this->set_content_data('SHIPPING_IMAGE', $main->getShippingStatusImage($p_coo_product->data['products_shippingtime']));
         }
         // BOF_GM_MOD:
         $this->set_content_data('FORM_ACTION', xtc_draw_form('cart_quantity', xtc_href_link(FILENAME_PRODUCT_INFO, xtc_get_all_get_params(array('action')) . 'action=add_product'), 'post', 'name="cart_quantity" onsubmit="gm_qty_check = new GMOrderQuantityChecker(); return gm_qty_check.check();"'));
         $this->set_content_data('FORM_ACTION_URL', xtc_href_link(FILENAME_PRODUCT_INFO, xtc_get_all_get_params(array('action')) . 'action=add_product'));
         $this->set_content_data('FORM_ID', 'cart_quantity');
         $this->set_content_data('FORM_NAME', 'cart_quantity');
         $this->set_content_data('FORM_METHOD', 'post');
         // BOF GM_MOD GX-Customizer
         $coo_gm_gprint_product_manager = new GMGPrintProductManager();
         if ($coo_gm_gprint_product_manager->get_surfaces_groups_id($p_coo_product->data['products_id']) !== false) {
             $coo_gm_gprint_configuration = new GMGPrintConfiguration($_SESSION['languages_id']);
             $this->set_content_data('GM_GPRINT_SHOW_PRODUCTS_DESCRIPTION', $coo_gm_gprint_configuration->get_configuration('SHOW_PRODUCTS_DESCRIPTION'));
             $this->set_content_data('GM_GPRINT', 1);
         }
         // EOF GM_MOD GX-Customizer
         $this->set_content_data('FORM_END', '</form>');
         $this->set_content_data('PRODUCTS_PRICE', $products_price['formated']);
         if ($p_coo_product->data['products_vpe_status'] == 1 && $p_coo_product->data['products_vpe_value'] != 0.0 && $products_price['plain'] > 0) {
             $this->set_content_data('PRODUCTS_VPE', $xtPrice->xtcFormat($products_price['plain'] * (1 / $p_coo_product->data['products_vpe_value']), true) . TXT_PER . xtc_get_vpe_name($p_coo_product->data['products_vpe']));
         }
         $this->set_content_data('PRODUCTS_ID', $p_coo_product->data['products_id']);
         $this->set_content_data('PRODUCTS_NAME', $p_coo_product->data['products_name']);
         // BOF GM_MOD:
         if ($_SESSION['customers_status']['customers_status_show_price'] != 0 && ($xtPrice->gm_check_price_status($p_coo_product->data['products_id']) == 0 || $xtPrice->gm_check_price_status($p_coo_product->data['products_id']) == 2 && $p_coo_product->data['products_price'] > 0)) {
             // price incl tax
             $tax_rate = $xtPrice->TAX[$p_coo_product->data['products_tax_class_id']];
             $tax_info = $main->getTaxInfo($tax_rate);
             $this->set_content_data('PRODUCTS_TAX_INFO', $tax_info);
             // BOF GM_MOD:
             if ($xtPrice->gm_check_price_status($p_coo_product->data['products_id']) == 0) {
                 $this->set_content_data('PRODUCTS_SHIPPING_LINK', $main->getShippingLink(true));
             }
         }
         // BOF GM_MOD
         if (gm_get_conf('GM_TELL_A_FRIEND') == 'true') {
             $this->set_content_data('GM_TELL_A_FRIEND', 1);
         }
         if ($p_coo_product->data['gm_show_price_offer'] == 1 && $_SESSION['customers_status']['customers_status_show_price'] != '0' && $xtPrice->gm_check_price_status($p_coo_product->data['products_id']) == 0) {
             $this->set_content_data('GM_PRICE_OFFER', 1);
         }
         if ((double) $p_coo_product->data['gm_min_order'] != 1) {
             $this->set_content_data('GM_MIN_ORDER', gm_convert_qty($p_coo_product->data['gm_min_order'], false));
         }
         if ((double) $p_coo_product->data['gm_graduated_qty'] != 1) {
             $this->set_content_data('GM_GRADUATED_QTY', gm_convert_qty($p_coo_product->data['gm_graduated_qty'], false));
         }
         // EOF GM_MOD
         $this->set_content_data('PRODUCTS_MODEL', $p_coo_product->data['products_model']);
         $this->set_content_data('PRODUCTS_EAN', $p_coo_product->data['products_ean']);
         if ($p_coo_product->data['gm_show_qty_info'] == 1) {
             $this->set_content_data('PRODUCTS_QUANTITY', gm_convert_qty(xtc_get_products_stock($p_coo_product->data['products_id']), false));
             if ($p_coo_product->data['quantity_unit_id'] > 0) {
                 $this->set_content_data('PRODUCTS_QUANTITY_UNIT', $p_coo_product->data['unit_name']);
             }
         }
         // BOF GM_MOD
         if ($p_coo_product->data['gm_show_weight'] == '1') {
             $this->set_content_data('SHOW_PRODUCTS_WEIGHT', 1);
             $this->set_content_data('PRODUCTS_WEIGHT', gm_prepare_number($p_coo_product->data['products_weight'], $xtPrice->currencies[$xtPrice->actualCurr]['decimal_point']));
         }
         // EOF GM_MOD
         $this->set_content_data('PRODUCTS_STATUS', $p_coo_product->data['products_status']);
         $this->set_content_data('PRODUCTS_ORDERED', $p_coo_product->data['products_ordered']);
         $this->set_content_data('PRODUCTS_PRINT', '<img src="templates/' . CURRENT_TEMPLATE . '/buttons/' . $_SESSION['language'] . '/print.gif"  style="cursor:hand;" onclick="javascript:window.open(\'' . xtc_href_link(FILENAME_PRINT_PRODUCT_INFO, 'products_id=' . $p_coo_product->data['products_id']) . '\', \'popup\', \'toolbar=0, width=640, height=600\')" alt="" />');
         //GM_MOD:
         $gmTabTokenizer = MainFactory::create_object('GMTabTokenizer', array(stripslashes($p_coo_product->data['products_description'])));
         $gm_products_descrition = $gmTabTokenizer->get_prepared_output();
         $this->set_content_data('PRODUCTS_DESCRIPTION', $gm_products_descrition);
         $t_gm_images_data = array();
         $t_thumbnails_array = array();
         $t_main_max_width = 369;
         $t_main_max_height = 279;
         $t_thumbnail_max_width = 86;
         $t_thumbnail_max_height = 86;
         // BOF GM_MOD
         require_once DIR_FS_CATALOG . 'gm/classes/GMGMotion.php';
         $coo_gm_gmotion = new GMGMotion();
         $this->set_content_data('GMOTION', $coo_gm_gmotion->check_status($p_coo_product->data['products_id']));
         // EOF GM_MOD
         if (isset($xsb_tx['XTB_REDIRECT_USER_TO']) && $xsb_tx['products_id'] == $p_coo_product->data['products_id']) {
             $this->set_content_data('XTB_REDIRECT_USER_TO', $xsb_tx['XTB_REDIRECT_USER_TO']);
         }
         // BOF GM_MOD
         if ($p_coo_product->data['products_image'] != '' && $p_coo_product->data['gm_show_image'] == '1') {
             $t_info_image_size_array = @getimagesize(DIR_WS_INFO_IMAGES . $p_coo_product->data['products_image']);
             $t_thumbnail_image_size_array = @getimagesize(DIR_WS_IMAGES . 'product_images/gallery_images/' . $p_coo_product->data['products_image']);
             $t_main_padding_left = 0;
             $t_main_padding_top = 0;
             if (isset($t_info_image_size_array[0]) && $t_info_image_size_array[0] < $t_main_max_width) {
                 $t_main_padding_left = round(($t_main_max_width - $t_info_image_size_array[0]) / 2);
             }
             if (isset($t_info_image_size_array[1]) && $t_info_image_size_array[1] < $t_main_max_height) {
                 $t_main_padding_top = round(($t_main_max_height - $t_info_image_size_array[1]) / 2);
             }
             $t_zoom_image = DIR_WS_POPUP_IMAGES . $p_coo_product->data['products_image'];
             if (file_exists(DIR_WS_ORIGINAL_IMAGES . $p_coo_product->data['products_image'])) {
                 $t_zoom_image = DIR_WS_ORIGINAL_IMAGES . $p_coo_product->data['products_image'];
             }
             $t_gm_images_data[] = array('IMAGE' => DIR_WS_INFO_IMAGES . $p_coo_product->data['products_image'], 'IMAGE_ALT' => $p_coo_product->data['gm_alt_text'], 'IMAGE_NR' => 0, 'ZOOM_IMAGE' => $t_zoom_image, 'PRODUCTS_NAME' => $p_coo_product->data['products_name'], 'PADDING_LEFT' => $t_main_padding_left, 'PADDING_TOP' => $t_main_padding_top, 'WIDTH' => $t_info_image_size_array[0], 'HEIGHT' => $t_info_image_size_array[1]);
             $t_thumbnail_padding_left = 0;
             $t_thumbnail_padding_top = 0;
             if (isset($t_thumbnail_image_size_array[0]) && $t_thumbnail_image_size_array[0] < $t_thumbnail_max_width) {
                 $t_thumbnail_padding_left = round(($t_thumbnail_max_width - $t_thumbnail_image_size_array[0]) / 2);
             }
             if (isset($t_thumbnail_image_size_array[1]) && $t_thumbnail_image_size_array[1] < $t_thumbnail_max_height) {
                 $t_thumbnail_padding_top = round(($t_thumbnail_max_height - $t_thumbnail_image_size_array[1]) / 2);
             }
             $t_thumbnails_array[] = array('IMAGE' => DIR_WS_IMAGES . 'product_images/gallery_images/' . $p_coo_product->data['products_image'], 'IMAGE_ALT' => $p_coo_product->data['gm_alt_text'], 'IMAGE_NR' => 0, 'ZOOM_IMAGE' => $t_zoom_image, 'INFO_IMAGE' => DIR_WS_INFO_IMAGES . $p_coo_product->data['products_image'], 'PRODUCTS_NAME' => $p_coo_product->data['products_name'], 'PADDING_LEFT' => $t_thumbnail_padding_left, 'PADDING_TOP' => $t_thumbnail_padding_top);
         }
         $t_gm_images = xtc_get_products_mo_images($p_coo_product->data['products_id']);
         if ($t_gm_images != false) {
             $coo_gm_alt_form = MainFactory::create_object('GMAltText');
             foreach ($t_gm_images as $t_gm_image) {
                 $t_info_image_size_array = @getimagesize(DIR_WS_INFO_IMAGES . $t_gm_image['image_name']);
                 $t_thumbnail_image_size_array = @getimagesize(DIR_WS_IMAGES . 'product_images/gallery_images/' . $t_gm_image['image_name']);
                 $t_main_padding_left = 0;
                 $t_main_padding_top = 0;
                 if (isset($t_info_image_size_array[0]) && $t_info_image_size_array[0] < $t_main_max_width) {
                     $t_main_padding_left = round(($t_main_max_width - $t_info_image_size_array[0]) / 2);
                 }
                 if (isset($t_info_image_size_array[1]) && $t_info_image_size_array[1] < $t_main_max_height) {
                     $t_main_padding_top = round(($t_main_max_height - $t_info_image_size_array[1]) / 2);
                 }
                 $t_zoom_image = DIR_WS_POPUP_IMAGES . $t_gm_image['image_name'];
                 if (file_exists(DIR_WS_ORIGINAL_IMAGES . $t_gm_image['image_name'])) {
                     $t_zoom_image = DIR_WS_ORIGINAL_IMAGES . $t_gm_image['image_name'];
                 }
                 $t_gm_images_data[] = array('IMAGE' => DIR_WS_INFO_IMAGES . $t_gm_image['image_name'], 'IMAGE_ALT' => $coo_gm_alt_form->get_alt($t_gm_image["image_id"], $t_gm_image['image_nr'], $p_coo_product->data['products_id']), 'IMAGE_NR' => $t_gm_image['image_nr'], 'ZOOM_IMAGE' => $t_zoom_image, 'PRODUCTS_NAME' => $p_coo_product->data['products_name'], 'PADDING_LEFT' => $t_main_padding_left, 'PADDING_TOP' => $t_main_padding_top, 'IMAGE_POPUP_URL' => DIR_WS_POPUP_IMAGES . $t_gm_image['image_name']);
                 $t_thumbnail_padding_left = 0;
                 $t_thumbnail_padding_top = 0;
                 if (isset($t_thumbnail_image_size_array[0]) && $t_thumbnail_image_size_array[0] < $t_thumbnail_max_width) {
                     $t_thumbnail_padding_left = round(($t_thumbnail_max_width - $t_thumbnail_image_size_array[0]) / 2);
                 }
                 if (isset($t_thumbnail_image_size_array[1]) && $t_thumbnail_image_size_array[1] < $t_thumbnail_max_height) {
                     $t_thumbnail_padding_top = round(($t_thumbnail_max_height - $t_thumbnail_image_size_array[1]) / 2);
                 }
                 $t_thumbnails_array[] = array('IMAGE' => DIR_WS_IMAGES . 'product_images/gallery_images/' . $t_gm_image['image_name'], 'IMAGE_ALT' => $coo_gm_alt_form->get_alt($t_gm_image["image_id"], $t_gm_image['image_nr'], $p_coo_product->data['products_id']), 'IMAGE_NR' => $t_gm_image['image_nr'], 'ZOOM_IMAGE' => $t_zoom_image, 'INFO_IMAGE' => DIR_WS_INFO_IMAGES . $t_gm_image['image_name'], 'PRODUCTS_NAME' => $p_coo_product->data['products_name'], 'PADDING_LEFT' => $t_thumbnail_padding_left, 'PADDING_TOP' => $t_thumbnail_padding_top);
             }
         }
         $this->set_content_data('images', $t_gm_images_data);
         $this->set_content_data('thumbnails', $t_thumbnails_array);
         // EOF GM_MOD
         $discount = 0.0;
         if ($_SESSION['customers_status']['customers_status_discount'] != '0.00') {
             // BOF GM_MOD:
             $discount = $_SESSION['customers_status']['customers_status_discount'];
             if ($p_coo_product->data['products_discount_allowed'] < $_SESSION['customers_status']['customers_status_discount']) {
                 $discount = $p_coo_product->data['products_discount_allowed'];
             }
             if ($discount != '0.00') {
                 $this->set_content_data('PRODUCTS_DISCOUNT', $discount . '%');
             }
         }
         // BOF GM_MOD
         if (PRODUCT_IMAGE_INFO_WIDTH < 190 - 16) {
             $this->set_content_data('MIN_IMAGE_WIDTH', 188);
             $this->set_content_data('MIN_INFO_BOX_WIDTH', 156 - 10);
             $this->set_content_data('MARGIN_LEFT', 188 + 10);
         } else {
             $this->set_content_data('MIN_IMAGE_WIDTH', PRODUCT_IMAGE_INFO_WIDTH + 16);
             $this->set_content_data('MIN_INFO_BOX_WIDTH', PRODUCT_IMAGE_INFO_WIDTH + 16 - 32 - 10);
             $this->set_content_data('MARGIN_LEFT', PRODUCT_IMAGE_INFO_WIDTH + 16 + 10);
         }
         // EOF GM_MOD
         $coo_product_attributes = MainFactory::create_object('ProductAttributesContentView', array($p_coo_product->data['options_template']));
         $t_view_html = $coo_product_attributes->get_html($p_coo_product);
         $this->set_content_data('MODULE_product_options', $t_view_html);
         $coo_product_reviews = MainFactory::create_object('ProductReviewsContentView');
         $t_view_html = $coo_product_reviews->get_html($p_coo_product);
         $this->set_content_data('MODULE_products_reviews', $t_view_html);
         if (xtc_not_null($p_coo_product->data['products_url'])) {
             $this->set_content_data('PRODUCTS_URL', sprintf(TEXT_MORE_INFORMATION, xtc_href_link(FILENAME_REDIRECT, 'action=product&id=' . $p_coo_product->data['products_id'], 'NONSSL', true)));
         }
         if ($p_coo_product->data['products_date_available'] > date('Y-m-d H:i:s')) {
             $this->set_content_data('PRODUCTS_DATE_AVIABLE', sprintf(TEXT_DATE_AVAILABLE, xtc_date_long($p_coo_product->data['products_date_available'])));
         } else {
             // BOF GM_MOD:
             if ($p_coo_product->data['products_date_added'] != '0000-00-00 00:00:00' && $p_coo_product->data['gm_show_date_added'] == 1) {
                 $this->set_content_data('PRODUCTS_ADDED', sprintf(TEXT_DATE_ADDED, xtc_date_long($p_coo_product->data['products_date_added'])));
             }
         }
         $coo_product_media = MainFactory::create_object('ProductMediaContentView');
         $t_view_html = $coo_product_media->get_html($p_coo_product->data['products_id'], $_SESSION['languages_id']);
         $this->set_content_data('MODULE_products_media', $t_view_html);
         $coo_graduated_prices = MainFactory::create_object('GraduatedPricesContentView');
         $t_view_html = $coo_graduated_prices->get_html($p_coo_product);
         $this->set_content_data('MODULE_graduated_price', $t_view_html);
         $coo_also_purchased = MainFactory::create_object('AlsoPurchasedContentView');
         $t_view_html = $coo_also_purchased->get_html($p_coo_product);
         $this->set_content_data('MODULE_also_purchased', $t_view_html);
         $coo_cross_selling = MainFactory::create_object('CrossSellingContentView', array('cross_selling'));
         $t_view_html = $coo_cross_selling->get_html($p_coo_product);
         $this->set_content_data('MODULE_cross_selling', $t_view_html);
         $coo_reverse_cross_selling = MainFactory::create_object('CrossSellingContentView', array('reverse_cross_selling'));
         $t_view_html = $coo_reverse_cross_selling->get_html($p_coo_product);
         $this->set_content_data('MODULE_reverse_cross_selling', $t_view_html);
         $i = count($_SESSION['tracking']['products_history']);
         if ($i > 6) {
             array_shift($_SESSION['tracking']['products_history']);
             $_SESSION['tracking']['products_history'][6] = $p_coo_product->data['products_id'];
             $_SESSION['tracking']['products_history'] = array_unique($_SESSION['tracking']['products_history']);
         } else {
             $_SESSION['tracking']['products_history'][$i] = $p_coo_product->data['products_id'];
             $_SESSION['tracking']['products_history'] = array_unique($_SESSION['tracking']['products_history']);
         }
         $coo_stop_watch = new StopWatch();
         $coo_stop_watch->start();
         $coo_properties_view = MainFactory::create_object('PropertiesView', array($_GET, $_POST));
         $t_properties_selection_form = $coo_properties_view->get_selection_form($p_coo_product->data['products_id'], $_SESSION['languages_id']);
         if (trim($t_properties_selection_form) != "") {
             if ($p_coo_product->data['gm_show_qty_info'] == 1) {
                 if ($p_coo_product->data['use_properties_combis_quantity'] == 0 && STOCK_CHECK == 'true' && ATTRIBUTES_STOCK_CHECK == 'true' || $p_coo_product->data['use_properties_combis_quantity'] == 2) {
                     $this->set_content_data('PRODUCTS_QUANTITY', '-');
                     $this->set_content_data('SHOW_PRODUCTS_QUANTITY', true);
                 } else {
                     if ($p_coo_product->data['use_properties_combis_quantity'] == 1) {
                         $this->set_content_data('SHOW_PRODUCTS_QUANTITY', true);
                     }
                 }
             }
             $this->set_content_data('SHOW_PRODUCTS_MODEL', true);
             if (APPEND_PROPERTIES_MODEL == "false" || trim($p_coo_product->data['products_model']) == '') {
                 $this->set_content_data('PRODUCTS_MODEL', '-');
             }
             if (ACTIVATE_SHIPPING_STATUS == 'true' && $xtPrice->gm_check_price_status($p_coo_product->data['products_id']) == 0 && $p_coo_product->data['use_properties_combis_shipping_time'] == 1) {
                 $this->set_content_data('SHOW_SHIPPING_TIME', true);
                 $this->set_content_data('SHIPPING_NAME', '');
                 $this->set_content_data('SHIPPING_IMAGE', 'admin/images/icons/gray.png');
             }
         }
         $this->set_content_data('properties_selection_form', $t_properties_selection_form);
         $coo_stop_watch->stop();
         //$coo_stop_watch->log_total_time('PropertiesView get_selection_form');
         // BOF GM_MOD
         $t_gm_show_wishlist = gm_get_conf('GM_SHOW_WISHLIST');
         if ($t_gm_show_wishlist == 'true') {
             $this->set_content_data('GM_SHOW_WISHLIST', 1);
         }
         $t_show_facebook = gm_get_conf('SHOW_FACEBOOK');
         if ($t_show_facebook == 'true') {
             $this->set_content_data('SHOW_FACEBOOK', 1);
         }
         $t_show_twitter = gm_get_conf('SHOW_TWITTER');
         if ($t_show_twitter == 'true') {
             $this->set_content_data('SHOW_TWITTER', 1);
         }
         $t_show_googleplus = gm_get_conf('SHOW_GOOGLEPLUS');
         if ($t_show_googleplus == 'true') {
             $this->set_content_data('SHOW_GOOGLEPLUS', 1);
         }
         $t_show_pinterest = gm_get_conf('SHOW_PINTEREST');
         if ($t_show_pinterest == 'true') {
             $this->set_content_data('SHOW_PINTEREST', 1);
         }
         $t_show_print = gm_get_conf('SHOW_PRINT');
         if ($t_show_print == 'true') {
             $this->set_content_data('SHOW_PRINT', 1);
         }
         $t_show_bookmarking = gm_get_conf('SHOW_BOOKMARKING');
         if ($t_show_bookmarking == 'true') {
             $this->set_content_data('SHOW_BOOKMARKING', 1);
         }
         // EOF GM_MOD
         // Bitcoin Payment - Commerce Coding - BEGIN
         $multiplier = 1;
         $digits = 8;
         switch (MODULE_PAYMENT_BITCOIN_UNITS) {
             case 'uBTC':
                 $multiplier *= 1000;
                 $digits -= 3;
             case 'mBTC':
                 $multiplier *= 1000;
                 $digits -= 3;
             case 'BTC':
                 $btcPrice = number_format($products_price['plain'] / MODULE_PAYMENT_BITCOIN_BTCEUR * $multiplier, $digits, '.', '');
                 $this->set_content_data('BITCOIN_PRICE', $btcPrice . ' ' . MODULE_PAYMENT_BITCOIN_UNITS);
         }
         // Bitcoin Payment - Commerce Coding - END
         include_once DIR_FS_DOCUMENT_ROOT . '/shopgate/plugins/gambiogx/system/views/product_info/ProductInfoContentView.inc.php';
         $t_html_output = $this->build_html();
     }
     return $t_html_output;
 }
コード例 #13
0
ファイル: orders.php プロジェクト: ratepay/gambio-module
    $oID = xtc_db_prepare_input($_GET['oID']);
    $orders_query = xtc_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . xtc_db_input($oID) . "'");
    $order_exists = true;
    if (!xtc_db_num_rows($orders_query)) {
        $orders_query = xtc_db_query("select orders_id from " . TABLE_ORDERS . " where gm_orders_id = '" . xtc_db_input($oID) . "' LIMIT 1");
        if (!xtc_db_num_rows($orders_query)) {
            $order_exists = false;
            $messageStack->add(sprintf(ERROR_ORDER_DOES_NOT_EXIST, $oID), 'error');
        } else {
            $t_result_array = xtc_db_fetch_array($orders_query);
            xtc_redirect(xtc_href_link(FILENAME_ORDERS, 'action=edit&oID=' . (int) $t_result_array['orders_id']));
        }
    }
    // BOF eKomi
    if (gm_get_conf('EKOMI_STATUS') == '1') {
        $coo_ekomi_manager = MainFactory::create_object('EkomiManager', array(gm_get_conf('EKOMI_API_ID'), gm_get_conf('EKOMI_API_PASSWORD')));
        if (isset($_GET['ekomi']) && $_GET['ekomi'] == 'send_mail') {
            $t_success = $coo_ekomi_manager->send_mails($_GET['oID'], true);
            if ($t_success) {
                $messageStack->add(EKOMI_SEND_MAIL_SUCCESS, 'success');
            } elseif ($coo_ekomi_manager->mail_already_sent($_GET['oID'])) {
                $messageStack->add(EKOMI_ALREADY_SEND_MAIL_ERROR, 'error');
            } else {
                $messageStack->add(EKOMI_SEND_MAIL_ERROR, 'error');
            }
        }
    }
    // EOF eKomi
}
require DIR_WS_CLASSES . 'order.php';
if (($_GET['action'] == 'edit' || $_GET['action'] == 'update_order') && $order_exists) {