Ankündigung

Einklappen
Keine Ankündigung bisher.

[behoben in 1.2.1] Data truncated for column 'carrier'

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    (Zen-Cart 1.5.6) [behoben in 1.2.1] Data truncated for column 'carrier'

    Hallo Ihr Lieben,

    leider haben wir ein ganz großes Problem. Unser Provider hat unseren Webshop auf einen anderen Server umgezogen. Leider kommen jetzt sehr viele Fehlermeldungen, bei Bestellungen die über Paypal oder Paypal-Express ausgeführt werden. Ich hänge Euch das Logfile mal unten an.

    Code:
    [13-Aug-2020 18:14:24 Europe/Berlin] Request URI: /checkout_process, IP address: 2.203.156.12#1 ot_netto->__construct() called at [/xxx/www/xxx/xxx/xxx/www/xxx/includes/classes/order_total.php:51]
    #2 order_total->__construct() called at [/xxx/www/xxx/xxx/xxx/www/xxx/includes/modules/checkout_process.php:61]
    #3 require([/xxx/www/xxx/xxx/xxx/www/xxx/includes/modules/checkout_process.php) called at [/xxx/www/xxx/xxx/xxx/www/xxx/includes/modules/pages/checkout_process/header_php.php:14]
    #4 require([/xxx/www/xxx/xxx/xxx/www/xxx/includes/modules/pages/checkout_process/header_php.php) called at [/xxx/www/xxx/xxx/xxx/www/xxx/index.php:36]
    --> PHP Warning: Use of undefined constant MODULE_PAYMENT_INVOICE_STATUS - assumed 'MODULE_PAYMENT_INVOICE_STATUS' (this will throw an Error in a future version of PHP) in /xxx/www/xxx/xxx/xxx/www/xxx/includes/modules/order_total/ot_netto.php on line 19.
    
    
    [13-Aug-2020 18:14:25 Europe/Berlin] Request URI: /checkout_process, IP address: 2.203.156.12
    #1 trigger_error() called at [/xxx/www/xxx/xxx/xxx/www/xxx/includes/classes/db/mysql/query_factory.php:171]
    #2 queryFactory->show_error() called at [/xxx/www/xxx/xxx/xxx/www/xxx/includes/classes/db/mysql/query_factory.php:143]
    #3 queryFactory->set_error() called at [/xxx/www/xxx/xxx/xxx/www/xxx/includes/classes/db/mysql/query_factory.php:270]
    #4 queryFactory->Execute() called at [/xxx/www/xxx/xxx/xxx/www/xxx/includes/functions/functions_general.php:952]
    #5 zen_db_perform() called at [/xxx/www/xxx/xxx/xxx/www/xxx/includes/classes/order.php:822]
    #6 order->create() called at [/xxx/www/xxx/xxx/xxx/www/xxx/includes/modules/checkout_process.php:95]
    #7 require(/xxx/www/xxx/xxx/xxx/www/xxx/includes/modules/checkout_process.php) called at [/xxx/www/xxx/xxx/xxx/www/xxx/includes/modules/pages/checkout_process/header_php.php:14]
    #8 require(/xxx/www/xxx/xxx/xxx/www/xxx/includes/modules/pages/checkout_process/header_php.php) called at [/xxx/www/xxx/xxx/xxx/www/xxx/index.php:36]
    --> PHP Fatal error: 1265:Data truncated for column 'carrier' at row 1 :: INSERT INTO orders (customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_tva_intracom, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, payment_module_code, shipping_method, shipping_module_code, coupon_code, cc_type, cc_owner, cc_number, cc_expires, date_purchased, orders_status, order_total, order_tax, currency, currency_value, carrier, COWOA_order, order_device) VALUES ('299', 'xxx', '', 'xxx', '', 'xx', 'xxx', '', 'xxx', 'xxx', 'xxx', '5', 'xxxx', '', 'xxx', '', 'xxx', 'xxx', 'xxx', 'xxx', '5', 'xxx', '', '', 'xxx', '', 'xxx', '72810', '', 'xxx', '5', 'PayPal', 'paypalwpp', 'Selbstabholung (Abholung)', 'storepickup', '', '', '', '', '', now(), '1', '0.500076', '0.068976', 'EUR', '1.000000', '', '1', 'Desktop') ==> (as called by) /xxx/www/xxx/xxx/xxx/www/xxx/includes/functions/functions_general.php on line 952 <== in /xxx/www/xxx/xxx/xxx/www/xxx/includes/classes/db/mysql/query_factory.php on line 171.
    Vielleicht kann jemand weiterhelfen, was wir abändern müssen damit Paypal wieder geht. Verwendet wird die Version 1.5.6d, die bisher fehlerlos lief.

    Liebe Grüße

    Kräuterhexe

    #2
    Poste den kompletten Inhalt der folgenden Dateien als Code (# Schaltfläche im Editor verwenden)

    1)
    includes/classes/order.php

    2)
    includes/modules/pages/checkout_confirmation/header_php.php

    3)
    includes/templates/DEINTEMPLATE/templates/tpl_checkout_confirmation_default.php

    Kommentar


      #3
      Erstmal Danke für die Hilfe

      Hier die geforderten Files:

      1.) includes/classes/order.php

      Code:
      <?php/**
       * Zen Cart German Specific
       * File contains the order-processing class ("order")
       *
       * @package classes
       * @copyright Copyright 2003-2019 Zen Cart Development Team
       * @license https://www.zen-cart-pro.at/license/3_0.txt GNU General Public License V3.0
       * @version $Id: order.php for COWOA 2019-11-02 16:58:03Z webchills $
       * @version $Id: order.php for UID 2019-11-06 09:11:25Z webchills $ 
       * @version $Id: order.php for Datenweitergabe an Versandunternehmen 2019-11-08 18:20:25Z webchills $
       */
      /**
       * order class
       *
       * Handles all order-processing functions
       *
       * Dependencies:
       * $_SESSION['billto']
       * $_SESSION['cart']
       * $_SESSION['cc_id']
       * $_SESSION['comments']
       * $_SESSION['currency']
       * $_SESSION['customer_id']
       * $_SESSION['customers_ip_address']
       * $_SESSION['languages_id']
       * $_SESSION['payment']
       * $_SESSION['sendto']
       * $_SESSION['shipping']
       *
       * @package classes
       */
      if (!defined('IS_ADMIN_FLAG')) {
        die('Illegal Access');
      }
      class order extends base {
        var $info, $totals, $products, $customer, $delivery, $billing, $content_type, $email_low_stock, $products_ordered_attributes,
            $products_ordered, $products_ordered_email, $products_ordered_html, $attachArray, $email_order_message, $extra_header_text,
            $doStockDecrement, $send_low_stock_emails, $queryReturnFlag, $bestSellersUpdate, $use_external_tax_handler_only;
        var $products_ordered_attributes_html = array();
      
      
        function __construct($order_id = null) {
          $this->info = array();
          $this->totals = array();
          $this->products = array();
          $this->customer = array();
          $this->delivery = array();
      
      
          $this->notify('NOTIFY_ORDER_INSTANTIATE', array(), $order_id);
          if (zen_not_null($order_id)) {
            $this->query($order_id);
          } else {
            $this->cart();
          }
        }
      
      
        function query($order_id) {
          global $db;
      
      
          $order_id = zen_db_prepare_input($order_id);
          $this->queryReturnFlag = NULL;
          $this->notify('NOTIFY_ORDER_BEFORE_QUERY', array(), $order_id);
          if ($this->queryReturnFlag === TRUE) return false;
      
      
          $order_query = "select *
                              from " . TABLE_ORDERS . "
                              where orders_id = '" . (int)$order_id . "'";
      
      
          $order = $db->Execute($order_query);
          if ($order->EOF) return false;
      
      
          $totals_query = "select title, text, class, value
                               from " . TABLE_ORDERS_TOTAL . "
                               where orders_id = '" . (int)$order_id . "'
                               order by sort_order";
      
      
          $totals = $db->Execute($totals_query);
      
      
          while (!$totals->EOF) {
      
      
      
      
            if ($totals->fields['class'] == 'ot_coupon') {
              $coupon_link_query = "SELECT coupon_id
                      from " . TABLE_COUPONS . "
                      where coupon_code ='" . $order->fields['coupon_code'] . "'";
              $coupon_link = $db->Execute($coupon_link_query);
              if (IS_ADMIN_FLAG === true) {
                $zc_coupon_link = '<a href="javascript:couponpopupWindow(\'' . zen_catalog_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $coupon_link->fields['coupon_id']) . '\')">';
              } else { 
                $zc_coupon_link = '<a href="javascript:couponpopupWindow(\'' . zen_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $coupon_link->fields['coupon_id']) . '\')">';
              }
            }
            $this->totals[] = array('title' => ($totals->fields['class'] == 'ot_coupon' ? $zc_coupon_link . $totals->fields['title'] . '</a>' : $totals->fields['title']),
                                    'text' => $totals->fields['text'],
                                    'class' => $totals->fields['class'],
                                    'value' => $totals->fields['value'],
                       );
            $totals->MoveNext();
          }
      
      
          $order_total_query = "select text, value
                                   from " . TABLE_ORDERS_TOTAL . "
                                   where orders_id = '" . (int)$order_id . "'
                                   and class = 'ot_total'";
      
      
      
      
          $order_total = $db->Execute($order_total_query);
      
      
      
      
          $shipping_method_query = "select title, value
                                      from " . TABLE_ORDERS_TOTAL . "
                                      where orders_id = '" . (int)$order_id . "'
                                      and class = 'ot_shipping'";
      
      
      
      
          $shipping_method = $db->Execute($shipping_method_query);
      
      
          $order_status_query = "select orders_status_name
                                   from " . TABLE_ORDERS_STATUS . "
                                   where orders_status_id = '" . $order->fields['orders_status'] . "'
                                   and language_id = '" . (int)$_SESSION['languages_id'] . "'";
      
      
          $order_status = $db->Execute($order_status_query);
          
          // bof UID 
          switch (STORE_PRODUCT_TAX_BASIS) {
            case 'Shipping':
      
      
            $tax_address_query = "select ab.entry_country_id, ab.entry_zone_id
                                    from " . TABLE_ADDRESS_BOOK . " ab
                                    left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id)
                                    where ab.customers_id = '" . (int)$_SESSION['customer_id'] . "'
                                    and ab.address_book_id = '" . (int)($this->content_type == 'virtual' ? $_SESSION['billto'] : $_SESSION['sendto']) . "'";
            $tax_address = $db->Execute($tax_address_query);
            break;
            case 'Billing':
      
      
            $tax_address_query = "select ab.entry_country_id, ab.entry_zone_id
                                    from " . TABLE_ADDRESS_BOOK . " ab
                                    left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id)
                                    where ab.customers_id = '" . (int)$_SESSION['customer_id'] . "'
                                    and ab.address_book_id = '" . (int)$_SESSION['billto'] . "'";
            $tax_address = $db->Execute($tax_address_query);
            break;
            case 'Store':
            if ($billing_address->fields['entry_zone_id'] == STORE_ZONE) {
      
      
              $tax_address_query = "select ab.entry_country_id, ab.entry_zone_id
                                      from " . TABLE_ADDRESS_BOOK . " ab
                                      left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id)
                                      where ab.customers_id = '" . (int)$_SESSION['customer_id'] . "'
                                      and ab.address_book_id = '" . (int)$_SESSION['billto'] . "'";
            } else {
              $tax_address_query = "select ab.entry_country_id, ab.entry_zone_id
                                      from " . TABLE_ADDRESS_BOOK . " ab
                                      left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id)
                                      where ab.customers_id = '" . (int)$_SESSION['customer_id'] . "'
                                      and ab.address_book_id = '" . (int)($this->content_type == 'virtual' ? $_SESSION['billto'] : $_SESSION['sendto']) . "'";
            }
            $tax_address = $db->Execute($tax_address_query);
          }
      // eof UID
      
      
          $this->info = array('currency' => $order->fields['currency'],
                              'currency_value' => $order->fields['currency_value'],
                              'payment_method' => $order->fields['payment_method'],
                              'payment_module_code' => $order->fields['payment_module_code'],
                              'shipping_method' => $order->fields['shipping_method'],
                              'shipping_module_code' => $order->fields['shipping_module_code'],
                              'coupon_code' => $order->fields['coupon_code'],
                              'cc_type' => $order->fields['cc_type'],
                              'cc_owner' => $order->fields['cc_owner'],
                              'cc_number' => $order->fields['cc_number'],
                              'cc_cvv' => $order->fields['cc_cvv'],
                              'cc_expires' => $order->fields['cc_expires'],
                              'date_purchased' => $order->fields['date_purchased'],
                              'orders_status' => $order->fields['orders_status'],
                              'total' => $order->fields['order_total'],
                              'tax' => $order->fields['order_tax'],                        
                              'last_modified' => $order->fields['last_modified'],
                              'order_device' => $order->fields['order_device'],
                              'carrier' => $order->fields['carrier']
                              );
      
      
          $this->customer = array('id' => $order->fields['customers_id'],
                                  'name' => $order->fields['customers_name'],
                                  'company' => $order->fields['customers_company'],
                                  // bof UID
                                  'tva_intracom' => $billing_address->fields['entry_tva_intracom'], 
                                  'tva_intracom_tax' => $this->zen_tva_geo_tax($tax_address->fields['entry_country_id'], $billing_address->fields['entry_company'], $billing_address->fields['entry_tva_intracom']),
                                   // eof UID
                                  'street_address' => $order->fields['customers_street_address'],
                                  'suburb' => $order->fields['customers_suburb'],
                                  'city' => $order->fields['customers_city'],
                                  'postcode' => $order->fields['customers_postcode'],
                                  'state' => $order->fields['customers_state'],
                                  'country' => $order->fields['customers_country'],
                                  'format_id' => $order->fields['customers_address_format_id'],
                                  'telephone' => $order->fields['customers_telephone'],
                                  'email_address' => $order->fields['customers_email_address']);
      
      
          $this->delivery = array('name' => $order->fields['delivery_name'],
                                  'company' => $order->fields['delivery_company'],
                                  'street_address' => $order->fields['delivery_street_address'],
                                  'suburb' => $order->fields['delivery_suburb'],
                                  'city' => $order->fields['delivery_city'],
                                  'postcode' => $order->fields['delivery_postcode'],
                                  'state' => $order->fields['delivery_state'],
                                  'country' => $order->fields['delivery_country'],
                                  'format_id' => $order->fields['delivery_address_format_id']);
      
      
          if (($order->fields['shipping_module_code'] == 'storepickup') || 
              (empty($this->delivery['name']) && empty($this->delivery['street_address']))) {
            $this->delivery = false;
          }
      
      
          $this->billing = array('name' => $order->fields['billing_name'],
                                 'company' => $order->fields['billing_company'],
                                 // bof UID
                    'tva_intracom' => $order->fields['billing_tva_intracom'],
                    'tva_intracom_tax' => $this->zen_tva_geo_tax($tax_address->fields['entry_country_id'], $order->fields['billing_company'], $order->fields['billing_tva_intracom']),
                                  // eof UID
                                 'street_address' => $order->fields['billing_street_address'],
                                 'suburb' => $order->fields['billing_suburb'],
                                 'city' => $order->fields['billing_city'],
                                 'postcode' => $order->fields['billing_postcode'],
                                 'state' => $order->fields['billing_state'],
                                 'country' => $order->fields['billing_country'],
                                 'format_id' => $order->fields['billing_address_format_id']);
      
      
          $index = 0;
          $orders_products_query = "select *
                                        from " . TABLE_ORDERS_PRODUCTS . "
                                        where orders_id = '" . (int)$order_id . "'
                                        order by orders_products_id";
      
      
          $orders_products = $db->Execute($orders_products_query);
      
      
          while (!$orders_products->EOF) {
            // convert quantity to proper decimals - account history
            if (QUANTITY_DECIMALS != 0) {
              $fix_qty = $orders_products->fields['products_quantity'];
              switch (true) {
                case (false === strpos($fix_qty, '.')):
                $new_qty = $fix_qty;
                break;
                default:
                $new_qty = preg_replace('/[0]+$/', '', $orders_products->fields['products_quantity']);
                break;
              }
            } else {
              $new_qty = $orders_products->fields['products_quantity'];
            }
      
      
            $new_qty = round($new_qty, QUANTITY_DECIMALS);
      
      
            if ($new_qty == (int)$new_qty) {
              $new_qty = (int)$new_qty;
            }
      
      
            $this->products[$index] = array('qty' => $new_qty,
                                            'id' => $orders_products->fields['products_id'],
                                            'name' => $orders_products->fields['products_name'],
                                            'model' => $orders_products->fields['products_model'],
                                            'tax' => $orders_products->fields['products_tax'],
                                            'price' => $orders_products->fields['products_price'],
                                            'final_price' => $orders_products->fields['final_price'],
                                            'onetime_charges' => $orders_products->fields['onetime_charges'],
                                            'products_priced_by_attribute' => $orders_products->fields['products_priced_by_attribute'],
                                            'product_is_free' => $orders_products->fields['product_is_free'],
                                            'products_discount_type' => $orders_products->fields['products_discount_type'],
                                            'products_discount_type_from' => $orders_products->fields['products_discount_type_from'],
                                            'products_weight' => $orders_products->fields['products_weight'],
                                            'products_virtual' => (int)$orders_products->fields['products_virtual'],
                                            'product_is_always_free_shipping' => (int)$orders_products->fields['product_is_always_free_shipping'],
                                            'products_quantity_order_min' => $orders_products->fields['products_quantity_order_min'],
                                            'products_quantity_order_units' => $orders_products->fields['products_quantity_order_units'],
                                            'products_quantity_order_max' => $orders_products->fields['products_quantity_order_max'],
                                            'products_quantity_mixed' => (int)$orders_products->fields['products_quantity_mixed'],
                                            'products_mixed_discount_quantity' => (int)$orders_products->fields['products_mixed_discount_quantity'],
                                            );
      
      
            $subindex = 0;
            $attributes_query = "select products_options_id, products_options_values_id, products_options, products_options_values,
                                    options_values_price, price_prefix, product_attribute_is_free 
                                    from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . "
                                     where orders_id = " . (int)$order_id . "
                                     and orders_products_id = " . (int)$orders_products->fields['orders_products_id'] . "
                                ORDER BY orders_products_attributes_id ASC";
      
      
            $attributes = $db->Execute($attributes_query);
            if ($attributes->RecordCount()) {
              while (!$attributes->EOF) {
                $this->products[$index]['attributes'][$subindex] = array('option' => $attributes->fields['products_options'],
                                                                         'value' => $attributes->fields['products_options_values'],
                                                                         'option_id' => $attributes->fields['products_options_id'],
                                                                         'value_id' => $attributes->fields['products_options_values_id'],
                                                                         'prefix' => $attributes->fields['price_prefix'],
                                                                         'price' => $attributes->fields['options_values_price'],
                                                                         'product_attribute_is_free' => (int)$attributes->fields['product_attribute_is_free'],
      );
      
      
                $subindex++;
                $attributes->MoveNext();
              }
            }
      
      
            $this->info['tax_groups']["{$this->products[$index]['tax']}"] = '1';
      
      
            $this->notify('NOTIFY_ORDER_QUERY_ADD_PRODUCT', $this->products[$index], $index);
      
      
            $index++;
            $orders_products->MoveNext();
          }
      
      
          $this->notify('NOTIFY_ORDER_AFTER_QUERY', IS_ADMIN_FLAG, $order_id);
      
      
          /**
           * @deprecated since v1.5.6; use NOTIFY_ORDER_AFTER_QUERY instead
           */
          if (IS_ADMIN_FLAG === true) {
              $this->notify('ORDER_QUERY_ADMIN_COMPLETE', array('orders_id' => $order_id));
          }
      
      
        }
      
      
        function cart() {
          global $db, $currencies;
      
      
          $decimals = $currencies->get_decimal_places($_SESSION['currency']);
      
      
          $this->content_type = $_SESSION['cart']->get_content_type();
      
      
      
      
          $customer_address_query = "select c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_telephone,
                                          c.customers_email_address, ab.entry_company, ab.entry_tva_intracom, ab.entry_street_address,
                                          ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id,
                                          z.zone_name, co.countries_id, con.countries_name,
                                          co.countries_iso_code_2, co.countries_iso_code_3,
                                          co.address_format_id, ab.entry_state
                                         from (" . TABLE_CUSTOMERS . " c, " . TABLE_ADDRESS_BOOK . " ab )
                                         left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id)
                                         left join " . TABLE_COUNTRIES . " co on (ab.entry_country_id = co.countries_id)
                                         left join " . TABLE_COUNTRIES_NAME . " con on (ab.entry_country_id = con.countries_id)
                                         where c.customers_id = " . (!empty($_SESSION['customer_id']) ? (int)$_SESSION['customer_id'] : 0) . "
                                         and ab.customers_id = " . (!empty($_SESSION['customer_id']) ? (int)$_SESSION['customer_id'] : 0) . "
                                         and c.customers_default_address_id = ab.address_book_id
                                         and con.language_id = '" . (int)$_SESSION['languages_id'] . "'";
      
      
      
      
          $customer_address = $db->Execute($customer_address_query);
      
      
      
      
          $shipping_address_query = "select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_tva_intracom,
                                          ab.entry_street_address, ab.entry_suburb, ab.entry_postcode,
                                          ab.entry_city, ab.entry_zone_id, z.zone_name, ab.entry_country_id,
                                          c.countries_id, con.countries_name, c.countries_iso_code_2,
                                          c.countries_iso_code_3, c.address_format_id, ab.entry_state
                                         from " . TABLE_ADDRESS_BOOK . " ab
                                         left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id)
                                         left join " . TABLE_COUNTRIES . " c on (ab.entry_country_id = c.countries_id)
                                         left join " . TABLE_COUNTRIES_NAME . " con on (ab.entry_country_id = con.countries_id)
                                         where ab.customers_id = " . (!empty($_SESSION['customer_id']) ? (int)$_SESSION['customer_id'] : 0) . "
                                         and ab.address_book_id = " . (!empty($_SESSION['sendto']) ? (int)$_SESSION['sendto'] : 0) . "
                                         and con.language_id = '" . (int)$_SESSION['languages_id'] . "'";
      
      
      
      
          $shipping_address = $db->Execute($shipping_address_query);
      
      
      
      
          $billing_address_query = "select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_tva_intracom,
                                         ab.entry_street_address, ab.entry_suburb, ab.entry_postcode,
                                         ab.entry_city, ab.entry_zone_id, z.zone_name, ab.entry_country_id,
                                         c.countries_id, con.countries_name, c.countries_iso_code_2,
                                         c.countries_iso_code_3, c.address_format_id, ab.entry_state
                                        from " . TABLE_ADDRESS_BOOK . " ab
                                        left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id)
                                        left join " . TABLE_COUNTRIES . " c on (ab.entry_country_id = c.countries_id)
                                        left join " . TABLE_COUNTRIES_NAME . " con on (ab.entry_country_id = con.countries_id)
                                        where ab.customers_id = " . (!empty($_SESSION['customer_id']) ? (int)$_SESSION['customer_id'] : 0) . "
                                        and ab.address_book_id = " . (!empty($_SESSION['billto']) ? (int)$_SESSION['billto'] : 0) . "
                                        and con.language_id = '" . (int)$_SESSION['languages_id'] . "'";
      
      
          $billing_address = $db->Execute($billing_address_query);
      
      
          // set default tax calculation for not-logged-in visitors
            $taxCountryId = $taxZoneId = 0;
      
      
            // get tax zone info for logged-in visitors
            if (isset($_SESSION['customer_id']) && (int)$_SESSION['customer_id'] > 0) {
                $taxCountryId = $taxZoneId = -1;
                $tax_address_query = '';
                switch (STORE_PRODUCT_TAX_BASIS) {
                    case 'Shipping':
                        $tax_address_query = "select ab.entry_country_id, ab.entry_zone_id
                                      from " . TABLE_ADDRESS_BOOK . " ab
                                      left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id)
                                      where ab.customers_id = " . (int)$_SESSION['customer_id'] . "
                                      and ab.address_book_id = " . ($this->content_type == 'virtual' ? (int)$_SESSION['billto'] : (int)$_SESSION['sendto']);
                        break;
                    case 'Billing':
                        $tax_address_query = "select ab.entry_country_id, ab.entry_zone_id
                                      from " . TABLE_ADDRESS_BOOK . " ab
                                      left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id)
                                      where ab.customers_id = " . (int)$_SESSION['customer_id'] . "
                                      and ab.address_book_id = " . (int)$_SESSION['billto'];
                        break;
                    case 'Store':
                        if ($billing_address->fields['entry_zone_id'] == STORE_ZONE) {
      
      
                            $tax_address_query = "select ab.entry_country_id, ab.entry_zone_id
                                        from " . TABLE_ADDRESS_BOOK . " ab
                                        left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id)
                                        where ab.customers_id = " . (int)$_SESSION['customer_id'] . "
                                        and ab.address_book_id = " . (int)$_SESSION['billto'];
                        } else {
                            $tax_address_query = "select ab.entry_country_id, ab.entry_zone_id
                                        from " . TABLE_ADDRESS_BOOK . " ab
                                        left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id)
                                        where ab.customers_id = " . (int)$_SESSION['customer_id'] . "
                                        and ab.address_book_id = " . ($this->content_type == 'virtual' ? (int)$_SESSION['billto'] : (int)$_SESSION['sendto']);
                        }
                }
                if ($tax_address_query != '') {
                    $tax_address = $db->Execute($tax_address_query);
                    if ($tax_address->RecordCount() > 0) {
                        $taxCountryId = $tax_address->fields['entry_country_id'];
                        $taxZoneId = $tax_address->fields['entry_zone_id'];
                    }
                }
            }
      
      
          $class =& $_SESSION['payment'];
      
      
          if (isset($_SESSION['cc_id'])) {
            $coupon_code_query = "select coupon_code
                                    from " . TABLE_COUPONS . "
                                    where coupon_id = '" . (int)$_SESSION['cc_id'] . "'";
      
      
            $coupon_code = $db->Execute($coupon_code_query);
      
      
      
      
          }
      
      
          $this->info = array('order_status' => DEFAULT_ORDERS_STATUS_ID,
                              'currency' => $_SESSION['currency'],
                              'currency_value' => $currencies->currencies[$_SESSION['currency']]['value'],
                              'payment_method' => (isset($GLOBALS[$class]) && is_object($GLOBALS[$class])) ? $GLOBALS[$class]->title : '',
                              'payment_module_code' => (isset($GLOBALS[$class]) && is_object($GLOBALS[$class])) ? $GLOBALS[$class]->code : '',
                              'coupon_code' => isset($coupon_code) && is_object($coupon_code) ? $coupon_code->fields['coupon_code'] : '',
          //                          'cc_type' => (isset($GLOBALS['cc_type']) ? $GLOBALS['cc_type'] : ''),
          //                          'cc_owner' => (isset($GLOBALS['cc_owner']) ? $GLOBALS['cc_owner'] : ''),
          //                          'cc_number' => (isset($GLOBALS['cc_number']) ? $GLOBALS['cc_number'] : ''),
          //                          'cc_expires' => (isset($GLOBALS['cc_expires']) ? $GLOBALS['cc_expires'] : ''),
          //                          'cc_cvv' => (isset($GLOBALS['cc_cvv']) ? $GLOBALS['cc_cvv'] : ''),
                              'shipping_method' => (isset($_SESSION['shipping']['title'])) ? $_SESSION['shipping']['title'] : '',
                              'shipping_module_code' => (isset($_SESSION['shipping']['id']) && strpos($_SESSION['shipping']['id'], '_') > 0 ? $_SESSION['shipping']['id'] : (isset($_SESSION['shipping']) ? $_SESSION['shipping'] : array())),
                              'shipping_cost' => !empty($_SESSION['shipping']['cost']) ? $_SESSION['shipping']['cost'] : 0,
                              'subtotal' => 0,
                              'shipping_tax' => 0,
                              'tax' => 0,
                              'total' => 0,
                              'tax_groups' => array(),
                              'comments' => (isset($_SESSION['comments']) ? $_SESSION['comments'] : ''),
                              'carrier' => (isset($_SESSION['carrier']) ? $_SESSION['carrier'] : '')
                              );
      
      
          //print_r($GLOBALS[$class]);
          //echo $class;
          //print_r($GLOBALS);
          //echo $_SESSION['payment'];
          /*
          // this is set above to the module filename it should be set to the module title like Checks/Money Order rather than moneyorder
          if (isset(${$_SESSION['payment']}) && is_object(${$_SESSION['payment']})) {
          $this->info['payment_method'] = ${$_SESSION['payment']}->title;
          }
          */
      
      
          if ($customer_address->RecordCount() > 0) {
            $this->customer = array('gender' => $customer_address->fields['customers_gender'],
                                    'firstname' => $customer_address->fields['customers_firstname'],
                                    'lastname' => $customer_address->fields['customers_lastname'],
                                    'company' => $customer_address->fields['entry_company'],
      // bof UID
                                  'tva_intracom' => $billing_address->fields['entry_tva_intracom'], // ->fields !?
                                  'tva_intracom_tax' => $this->zen_tva_geo_tax($tax_address->fields['entry_country_id'], $billing_address->fields['entry_company'], $billing_address->fields['entry_tva_intracom']),
      // eof UID
                                    'street_address' => $customer_address->fields['entry_street_address'],
                                    'suburb' => $customer_address->fields['entry_suburb'],
                                    'city' => $customer_address->fields['entry_city'],
                                    'postcode' => $customer_address->fields['entry_postcode'],
                                    'state' => ((zen_not_null($customer_address->fields['entry_state'])) ? $customer_address->fields['entry_state'] : $customer_address->fields['zone_name']),
                                    'zone_id' => $customer_address->fields['entry_zone_id'],
                                    'country' => array('id' => $customer_address->fields['countries_id'], 'title' => $customer_address->fields['countries_name'], 'iso_code_2' => $customer_address->fields['countries_iso_code_2'], 'iso_code_3' => $customer_address->fields['countries_iso_code_3']),
                                    'format_id' => (int)$customer_address->fields['address_format_id'],
                                    'telephone' => $customer_address->fields['customers_telephone'],
                                    'email_address' => $customer_address->fields['customers_email_address']);
          }
      
      
          if ($shipping_address->RecordCount() > 0) {
            $this->delivery = array('firstname' => $shipping_address->fields['entry_firstname'],
                                    'lastname' => $shipping_address->fields['entry_lastname'],
                                    'company' => $shipping_address->fields['entry_company'],
                                    'street_address' => $shipping_address->fields['entry_street_address'],
                                    'suburb' => $shipping_address->fields['entry_suburb'],
                                    'city' => $shipping_address->fields['entry_city'],
                                    'postcode' => $shipping_address->fields['entry_postcode'],
                                    'state' => ((zen_not_null($shipping_address->fields['entry_state'])) ? $shipping_address->fields['entry_state'] : $shipping_address->fields['zone_name']),
                                    'zone_id' => $shipping_address->fields['entry_zone_id'],
                                    'country' => array('id' => $shipping_address->fields['countries_id'], 'title' => $shipping_address->fields['countries_name'], 'iso_code_2' => $shipping_address->fields['countries_iso_code_2'], 'iso_code_3' => $shipping_address->fields['countries_iso_code_3']),
                                    'country_id' => $shipping_address->fields['entry_country_id'],
                                    'format_id' => (int)$shipping_address->fields['address_format_id']);
          }
      
      
          if ($billing_address->RecordCount() > 0) {
            $this->billing = array('firstname' => $billing_address->fields['entry_firstname'],
                                   'lastname' => $billing_address->fields['entry_lastname'],
                                   'company' => $billing_address->fields['entry_company'],
      // bof UID
                                 'tva_intracom' => $billing_address->fields['entry_tva_intracom'],
                                 'tva_intracom_tax' => $this->zen_tva_geo_tax($tax_address->fields['entry_country_id'], $billing_address->fields['entry_company'], $billing_address->fields['entry_tva_intracom']),
      // eof UID
                                   'street_address' => $billing_address->fields['entry_street_address'],
                                   'suburb' => $billing_address->fields['entry_suburb'],
                                   'city' => $billing_address->fields['entry_city'],
                                   'postcode' => $billing_address->fields['entry_postcode'],
                                   'state' => ((zen_not_null($billing_address->fields['entry_state'])) ? $billing_address->fields['entry_state'] : $billing_address->fields['zone_name']),
                                   'zone_id' => $billing_address->fields['entry_zone_id'],
                                   'country' => array('id' => $billing_address->fields['countries_id'], 'title' => $billing_address->fields['countries_name'], 'iso_code_2' => $billing_address->fields['countries_iso_code_2'], 'iso_code_3' => $billing_address->fields['countries_iso_code_3']),
                                   'country_id' => $billing_address->fields['entry_country_id'],
                                   'format_id' => (int)$billing_address->fields['address_format_id']);
          }
      
      
          // -----
          // Issue a notification, allowing an observer to potentially make changes to any of the
          // order-related addresses and/or the country/zone information used to determine the
          // order's products' tax rate.
          //
          $this->notify('NOTIFY_ORDER_CART_AFTER_ADDRESSES_SET', '', $taxCountryId, $taxZoneId);
      
      
          $index = 0;
          $products = $_SESSION['cart']->get_products();
          for ($i=0, $n=sizeof($products); $i<$n; $i++) {
              // bof UID
            $tva_geo_tax = $this->billing['tva_intracom_tax'];
            $tva_tax = $tva_geo_tax? zen_get_tax_rate ($products[$i]['tax_class_id'], $tax_address->fields['entry_country_id'], $tax_address->fields['entry_zone_id']): 0;
            $tva_tax_description = $tva_geo_tax? zen_get_tax_description($products[$i]['tax_class_id'], $tax_address->fields['entry_country_id'], $tax_address->fields['entry_zone_id']): 0;
           // eof UID
            if (($i/2) == floor($i/2)) {
              $rowClass="rowEven";
            } else {
              $rowClass="rowOdd";
            }
            $taxRates = zen_get_multiple_tax_rates($products[$i]['tax_class_id'], $taxCountryId, $taxZoneId);
            $this->products[$index] = array('qty' => $products[$i]['quantity'],
                                            'name' => $products[$i]['name'],
                                            'merkmale' => $products[$i]['merkmale'],
                                            'model' => $products[$i]['model'],
                                            'image' => $products[$i]['image'], 
                                            'tax_groups'=>$taxRates,
                                            // TVA_INTRACOM REPLACE BEGIN
                                            'tax' => $tva_tax,
                                            'tax_description' => $tva_tax_description,
                                             // TVA_INTRACOM REPLACE END
                                            'price' => $products[$i]['price'],
                                            'final_price' => $products[$i]['price'] + $_SESSION['cart']->attributes_price($products[$i]['id']),
                                            'onetime_charges' => $_SESSION['cart']->attributes_price_onetime_charges($products[$i]['id'], $products[$i]['quantity']),
                                            'weight' => $products[$i]['weight'],
                                            'products_priced_by_attribute' => $products[$i]['products_priced_by_attribute'],
                                            'product_is_free' => $products[$i]['product_is_free'],
                                            'products_discount_type' => $products[$i]['products_discount_type'],
                                            'products_discount_type_from' => $products[$i]['products_discount_type_from'],
                                            'id' => $products[$i]['id'],
                                            'rowClass' => $rowClass,
                                            'products_weight' => (float)$products[$i]['weight'],
                                            'products_virtual' => (int)$products[$i]['products_virtual'],
                                            'product_is_always_free_shipping' => (int)$products[$i]['product_is_always_free_shipping'],
                                            'products_quantity_order_min' => (float)$products[$i]['products_quantity_order_min'],
                                            'products_quantity_order_units' => (float)$products[$i]['products_quantity_order_units'],
                                            'products_quantity_order_max' => (float)$products[$i]['products_quantity_order_max'],
                                            'products_quantity_mixed' => (int)$products[$i]['products_quantity_mixed'],
                                            'products_mixed_discount_quantity' => (int)$products[$i]['products_mixed_discount_quantity'],
                                            'tax' => zen_get_tax_rate($products[$i]['tax_class_id'], $taxCountryId, $taxZoneId),
                                            );
      
      
      
      
            if (STORE_PRODUCT_TAX_BASIS == 'Shipping' && isset($_SESSION['shipping']['id']) && stristr($_SESSION['shipping']['id'], 'storepickup') == TRUE)
            {
              $taxRates = zen_get_multiple_tax_rates($products[$i]['tax_class_id'], STORE_COUNTRY, STORE_ZONE);
              $this->products[$index]['tax'] = zen_get_tax_rate($products[$i]['tax_class_id'], STORE_COUNTRY, STORE_ZONE);
            } else
            {
                $taxRates = zen_get_multiple_tax_rates($products[$i]['tax_class_id'], $taxCountryId, $taxZoneId);
                $this->products[$index]['tax'] = zen_get_tax_rate($products[$i]['tax_class_id'], $taxCountryId, $taxZoneId);
            }
      
      
            $this->notify('NOTIFY_ORDER_CART_ADD_PRODUCT_LIST', array('index'=>$index, 'products'=>$products[$i]));
            if ($products[$i]['attributes']) {
              $subindex = 0;
              foreach ($products[$i]['attributes'] as $option => $value) {
      
      
                $attributes_query = "select popt.products_options_name, poval.products_options_values_name,
                                                pa.options_values_price, pa.price_prefix
                                         from " . TABLE_PRODUCTS_OPTIONS . " popt,
                                              " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval,
                                              " . TABLE_PRODUCTS_ATTRIBUTES . " pa
                                         where pa.products_id = '" . (int)$products[$i]['id'] . "'
                                         and pa.options_id = '" . (int)$option . "'
                                         and pa.options_id = popt.products_options_id
                                         and pa.options_values_id = '" . (int)$value . "'
                                         and pa.options_values_id = poval.products_options_values_id
                                         and popt.language_id = '" . (int)$_SESSION['languages_id'] . "'
                                         and poval.language_id = '" . (int)$_SESSION['languages_id'] . "'";
      
      
                $attributes = $db->Execute($attributes_query);
      
      
                //clr 030714 Determine if attribute is a text attribute and change products array if it is.
                if ($value == PRODUCTS_OPTIONS_VALUES_TEXT_ID){
                  $attr_value = $products[$i]['attributes_values'][$option];
                } else {
                  $attr_value = $attributes->fields['products_options_values_name'];
                }
      
      
                $this->products[$index]['attributes'][$subindex] = array('option' => $attributes->fields['products_options_name'],
                                                                         'value' => $attr_value,
                                                                         'option_id' => $option,
                                                                         'value_id' => $value,
                                                                         'prefix' => $attributes->fields['price_prefix'],
                                                                         'price' => $attributes->fields['options_values_price']);
      
      
                $this->notify('NOTIFY_ORDER_CART_ADD_ATTRIBUTE_LIST', array('index'=>$index, 'subindex'=>$subindex, 'products'=>$products[$i], 'attributes'=>$attributes));
                $subindex++;
              }
            }
      
      
            // add onetime charges here
            //$_SESSION['cart']->attributes_price_onetime_charges($products[$i]['id'], $products[$i]['quantity'])
      
      
            /**************************************
             * Check for external tax handling code
             **************************************/
            $this->use_external_tax_handler_only = FALSE;
            $this->notify('NOTIFY_ORDER_CART_EXTERNAL_TAX_HANDLING', array(), $index, $taxCountryId, $taxZoneId);
      
      
            if ($this->use_external_tax_handler_only == FALSE) {
              /*********************************************
               * Calculate taxes for this product
               *********************************************/
              /*
              $shown_price = (zen_add_tax($this->products[$index]['final_price'], $this->products[$index]['tax']))
              + zen_add_tax($this->products[$index]['onetime_charges'], $this->products[$index]['tax']);        
              $this->info['subtotal'] += $currencies->value($shown_price)* $this->products[$index]['qty'];
      
      
              $this->notify('NOTIFIY_ORDER_CART_SUBTOTAL_CALCULATE', array('shown_price'=>$shown_price));
              // find product's tax rate and description
              $products_tax = $this->products[$index]['tax'];
              $products_tax_description = $this->products[$index]['tax_description'];
      
      
              if (DISPLAY_PRICE_WITH_TAX == 'true') {
                // calculate the amount of tax "inc"luded in price (used if tax-in pricing is enabled)
                $tax_add = $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));
              } else {
                // calculate the amount of tax for this product (assuming tax is NOT included in the price)
        //        $tax_add = zen_round(($products_tax / 100) * $shown_price, $currencies->currencies[$this->info['currency']]['decimal_places']);
                $tax_add = ($products_tax/100) * $shown_price;
              }
              $this->info['tax'] += $tax_add;
              foreach ($taxRates as $taxDescription=>$taxRate)
              {
                $taxAdd = zen_calculate_tax($this->products[$index]['final_price']*$this->products[$index]['qty'], $taxRate)
                        +  zen_calculate_tax($this->products[$index]['onetime_charges'], $taxRate);
                if (isset($this->info['tax_groups'][$taxDescription]))
                {
                  $this->info['tax_groups'][$taxDescription] += $taxAdd;
                } else
                {
                  $this->info['tax_groups'][$taxDescription] = $taxAdd;
                }
              }
              */
              // TVA_INTRACOM REPLACE BEGIN
            $tva_tax = $this->customer['tva_intracom_tax'];
            if (!$tva_tax) {
              $vat_tax = 0;
              $vat_tax_description = TEXT_NO_TAX;
            } else {
              $vat_tax = $this->products[$index]['tax'];
              $vat_tax_description = $this->products[$index]['tax_description'];
            }
      
      
            $shown_price = (zen_add_tax($this->products[$index]['final_price'], $vat_tax) * $this->products[$index]['qty'])
      + zen_add_tax($this->products[$index]['onetime_charges'], $vat_tax);
            $this->info['subtotal'] += $shown_price;
      
      
            // find product's tax rate and description
            $products_tax = $vat_tax;
            $products_tax_description = $vat_tax_description;
      
      
            if (DISPLAY_PRICE_WITH_TAX == 'true') {
              // calculate the amount of tax "inc"luded in price (used if tax-in pricing is enabled)
              $tax_add = $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));
            } else {
              // calculate the amount of tax for this product (assuming tax is NOT included in the price)
              $tax_add = zen_round(($products_tax / 100) * $shown_price, $currencies->currencies[$this->info['currency']]['decimal_places']);
            }
            $this->info['tax'] += $tax_add;
            if (isset($this->info['tax_groups'][$products_tax_description])) {
              $this->info['tax_groups'][$products_tax_description] += $tax_add;
            } else {
              $this->info['tax_groups'][$products_tax_description] = $tax_add;
            }
      // TVA_INTRACOM REPLACE END
              /*********************************************
               * END: Calculate taxes for this product
               *********************************************/
          }
            $index++;
          }
      
      
          // Update the final total to include tax if not already tax-inc
          if (DISPLAY_PRICE_WITH_TAX == 'true') {
            $this->info['total'] = $this->info['subtotal'] + $this->info['shipping_cost'];
          } else {
            $this->info['total'] = $this->info['subtotal'] + $this->info['tax'] + $this->info['shipping_cost'];
          }
      
      
          if (isset($GLOBALS[$class]) && is_object($GLOBALS[$class])) {
            if ( isset($GLOBALS[$class]->order_status) && is_numeric($GLOBALS[$class]->order_status) && ($GLOBALS[$class]->order_status > 0) ) {
              $this->info['order_status'] = $GLOBALS[$class]->order_status;
            }
          }
          $this->notify('NOTIFY_ORDER_CART_FINISHED');
        }
      
      
        function create($zf_ot_modules, $zf_mode = 2) {
          global $db;
      
      
          $this->notify('NOTIFY_ORDER_CART_EXTERNAL_TAX_DURING_ORDER_CREATE', array(), $zf_ot_modules);
      
      
          if ($this->info['total'] == 0) {
            if (DEFAULT_ZERO_BALANCE_ORDERS_STATUS_ID == 0) {
              $this->info['order_status'] = (int)DEFAULT_ORDERS_STATUS_ID;
            } else {
              if ($_SESSION['payment'] != 'freecharger') {
                $this->info['order_status'] = (int)DEFAULT_ZERO_BALANCE_ORDERS_STATUS_ID;
              }
            }
          }
          $this->notify('NOTIFY_ORDER_CART_ORDERSTATUS');
      
      
          if (isset($_SESSION['shipping']['id']) && $_SESSION['shipping']['id'] == 'free_free') {
            $this->info['shipping_module_code'] = $_SESSION['shipping']['id'];
          }
      
      
          // Sanitize cc-num if present, using maximum 10 chars, with middle chars stripped out with XX
          if (isset($this->info['cc_number']) && strlen($this->info['cc_number']) > 10) {
            $cEnd = substr($this->info['cc_number'], -4);
            $cOffset = strlen($this->info['cc_number']) -4;
            $cStart = substr($this->info['cc_number'], 0, ($cOffset > 4 ? 4 : (int)$cOffset));
            $this->info['cc_number'] = str_pad($cStart, 6, 'X') . $cEnd;
          };
      
      
          $sql_data_array = array('customers_id' => $_SESSION['customer_id'],
                                  'customers_name' => $this->customer['firstname'] . ' ' . $this->customer['lastname'],
                                  'customers_company' => $this->customer['company'],
                                  'customers_street_address' => $this->customer['street_address'],
                                  'customers_suburb' => $this->customer['suburb'],
                                  'customers_city' => $this->customer['city'],
                                  'customers_postcode' => $this->customer['postcode'],
                                  'customers_state' => $this->customer['state'],
                                  'customers_country' => $this->customer['country']['title'],
                                  'customers_telephone' => $this->customer['telephone'],
                                  'customers_email_address' => $this->customer['email_address'],
                                  'customers_address_format_id' => $this->customer['format_id'],
                                  'delivery_name' => $this->delivery['firstname'] . ' ' . $this->delivery['lastname'],
                                  'delivery_company' => $this->delivery['company'],
                                  'delivery_street_address' => $this->delivery['street_address'],
                                  'delivery_suburb' => $this->delivery['suburb'],
                                  'delivery_city' => $this->delivery['city'],
                                  'delivery_postcode' => $this->delivery['postcode'],
                                  'delivery_state' => $this->delivery['state'],
                                  'delivery_country' => $this->delivery['country']['title'],
                                  'delivery_address_format_id' => $this->delivery['format_id'],
                                  'billing_name' => $this->billing['firstname'] . ' ' . $this->billing['lastname'],
                                  'billing_company' => $this->billing['company'],
                                  // bof UID
                                  'billing_tva_intracom' => $this->billing['tva_intracom'],
                                   // eof UID
                                  'billing_street_address' => $this->billing['street_address'],
                                  'billing_suburb' => $this->billing['suburb'],
                                  'billing_city' => $this->billing['city'],
                                  'billing_postcode' => $this->billing['postcode'],
                                  'billing_state' => $this->billing['state'],
                                  'billing_country' => $this->billing['country']['title'],
                                  'billing_address_format_id' => $this->billing['format_id'],
                                  'payment_method' => (($this->info['payment_module_code'] == '' and $this->info['payment_method'] == '') ? PAYMENT_METHOD_GV : $this->info['payment_method']),
                                  'payment_module_code' => (($this->info['payment_module_code'] == '' and $this->info['payment_method'] == '') ? PAYMENT_MODULE_GV : $this->info['payment_module_code']),
                                  'shipping_method' => $this->info['shipping_method'],
                                  'shipping_module_code' => (strpos($this->info['shipping_module_code'], '_') > 0 ? substr($this->info['shipping_module_code'], 0, strpos($this->info['shipping_module_code'], '_')) : $this->info['shipping_module_code']),
                                  'coupon_code' => $this->info['coupon_code'],
                                  'cc_type' => isset($this->info['cc_type']) ? $this->info['cc_type'] : '',
                                  'cc_owner' => isset($this->info['cc_owner']) ? $this->info['cc_owner'] : '',
                                  'cc_number' => isset($this->info['cc_number']) ? $this->info['cc_number'] : '',
                                  'cc_expires' => isset($this->info['cc_expires']) ? $this->info['cc_expires'] : '',
                                  'date_purchased' => 'now()',
                                  'orders_status' => $this->info['order_status'],
                                  'order_total' => $this->info['total'],
                                  'order_tax' => $this->info['tax'],
                                  'currency' => $this->info['currency'],
                                  'currency_value' => $this->info['currency_value'],                        
                                  'carrier' => $this->info['carrier']                           
                                  );
          if ($_SESSION['COWOA']) $sql_data_array['COWOA_order'] = 1;
          if ($_SESSION['mobilevisitor'] == true){
          $sql_data_array['order_device'] = 'Mobile';
          } else if ($_SESSION['tabletvisitor'] == true){
          $sql_data_array['order_device'] = 'Tablet';
          } else {
          $sql_data_array['order_device'] = 'Desktop';
          }
      
      
          zen_db_perform(TABLE_ORDERS, $sql_data_array);
          $insert_id = $db->insert_ID();
          $this->notify('NOTIFY_ORDER_DURING_CREATE_ADDED_ORDER_HEADER', array_merge(array('orders_id' => $insert_id, 'shipping_weight' => $_SESSION['cart']->weight), $sql_data_array), $insert_id);
      
      
          for ($i=0, $n=sizeof($zf_ot_modules); $i<$n; $i++) {
            $sql_data_array = array('orders_id' => $insert_id,
                                    'title' => $zf_ot_modules[$i]['title'],
                                    'text' => $zf_ot_modules[$i]['text'],
                                    'value' => (is_numeric($zf_ot_modules[$i]['value'])) ? $zf_ot_modules[$i]['value'] : '0',
                                    'class' => $zf_ot_modules[$i]['code'],
                                    'sort_order' => $zf_ot_modules[$i]['sort_order']);
      
      
            zen_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
            $ot_insert_id = $db->insert_ID();
            $this->notify('NOTIFY_ORDER_DURING_CREATE_ADDED_ORDERTOTAL_LINE_ITEM', $sql_data_array, $ot_insert_id);
          }
      
      
          $customer_notification = (SEND_EMAILS == 'true') ? '1' : '0';
          $sql_data_array = array('orders_id' => $insert_id,
                                  'orders_status_id' => $this->info['order_status'],
                                  'date_added' => 'now()',
                                  'customer_notified' => $customer_notification,
                                  'comments' => $this->info['comments']);
      
      
          zen_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
          $osh_insert_id = $db->insert_ID();
          $this->notify('NOTIFY_ORDER_DURING_CREATE_ADDED_ORDER_COMMENT', $sql_data_array, $osh_insert_id);
      
      
          return $insert_id;
      
      
        }
      
      
      
      
        function create_add_products($zf_insert_id, $zf_mode = false) {
          global $db, $currencies, $order_total_modules, $order_totals;
      
      
          // initialized for the email confirmation
          $this->products_ordered = '';
          $this->products_ordered_html = '';
          $this->subtotal = 0;
          $this->total_tax = 0;
      
      
          // lowstock email report
          $this->email_low_stock='';
      
      
          for ($i=0, $n=sizeof($this->products); $i<$n; $i++) {
            $custom_insertable_text = '';
      
      
            $this->doStockDecrement = (STOCK_LIMITED == 'true');
            $this->notify('NOTIFY_ORDER_PROCESSING_STOCK_DECREMENT_INIT', array('i'=>$i), $this->products[$i], $i);
            // Stock Update - Joao Correia
            if ($this->doStockDecrement) {
              if (DOWNLOAD_ENABLED == 'true') {
                $stock_query_raw = "select p.products_quantity, pad.products_attributes_filename, p.product_is_always_free_shipping
                                    from " . TABLE_PRODUCTS . " p
                                    left join " . TABLE_PRODUCTS_ATTRIBUTES . " pa
                                     on p.products_id=pa.products_id
                                    left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
                                     on pa.products_attributes_id=pad.products_attributes_id
                                    WHERE p.products_id = '" . zen_get_prid($this->products[$i]['id']) . "'";
      
      
                // Will work with only one option for downloadable products
                // otherwise, we have to build the query dynamically with a loop
                if (!empty($this->products[$i]['attributes']) && is_array($this->products[$i]['attributes'])) {
                  $products_attributes = $this->products[$i]['attributes'];
                  $stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'";
                }
                $stock_values = $db->Execute($stock_query_raw, false, false, 0, true);
              } else {
                $stock_values = $db->Execute("select * from " . TABLE_PRODUCTS . " where products_id = '" . zen_get_prid($this->products[$i]['id']) . "'", false, false, 0, true);
              }
      
      
              $this->notify('NOTIFY_ORDER_PROCESSING_STOCK_DECREMENT_BEGIN', $i, $stock_values);
      
      
              if ($stock_values->RecordCount() > 0) {
                // do not decrement quantities if products_attributes_filename exists
                if ((DOWNLOAD_ENABLED != 'true') || $stock_values->fields['product_is_always_free_shipping'] == 2 || (!$stock_values->fields['products_attributes_filename']) ) {
                  $stock_left = $stock_values->fields['products_quantity'] - $this->products[$i]['qty'];
                  $this->products[$i]['stock_reduce'] = $this->products[$i]['qty'];
                } else {
                  $stock_left = $stock_values->fields['products_quantity'];
                }
      
      
                //            $this->products[$i]['stock_value'] = $stock_values->fields['products_quantity'];
      
      
                $db->Execute("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . zen_get_prid($this->products[$i]['id']) . "'");
                //        if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) {
                if ($stock_left <= 0) {
                  // only set status to off when not displaying sold out
                  if (SHOW_PRODUCTS_SOLD_OUT == '0') {
                    $db->Execute("update " . TABLE_PRODUCTS . " set products_status = 0 where products_id = '" . zen_get_prid($this->products[$i]['id']) . "'");
                  }
                }
      
      
                // for low stock email
                if ( $stock_left <= STOCK_REORDER_LEVEL ) {
                  // WebMakers.com Added: add to low stock email
                  $this->email_low_stock .=  'ID# ' . zen_get_prid($this->products[$i]['id']) . "\t\t" . $this->products[$i]['model'] . "\t\t" . $this->products[$i]['name'] . "\t\t" . ' Qty Left: ' . $stock_left . "\n";
                }
              }
            }
      
      
            // Update products_ordered (for bestsellers list)
            $this->bestSellersUpdate = TRUE;
            $this->notify('NOTIFY_ORDER_PROCESSING_BESTSELLERS_UPDATE', array(), $this->products[$i], $i);
            if ($this->bestSellersUpdate) {
              $db->Execute("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%f', $this->products[$i]['qty']) . " where products_id = '" . zen_get_prid($this->products[$i]['id']) . "'");
            }
      
      
            $this->notify('NOTIFY_ORDER_PROCESSING_STOCK_DECREMENT_END', $i);
      
      
            $sql_data_array = array('orders_id' => $zf_insert_id,
                                    'products_id' => zen_get_prid($this->products[$i]['id']),
                                    'products_model' => $this->products[$i]['model'],
                                    'products_name' => $this->products[$i]['name'],
                                    'products_price' => $this->products[$i]['price'],
                                    'final_price' => $this->products[$i]['final_price'],
                                    'onetime_charges' => $this->products[$i]['onetime_charges'],
                                    'products_tax' => $this->products[$i]['tax'],
                                    'products_quantity' => $this->products[$i]['qty'],
                                    'products_priced_by_attribute' => $this->products[$i]['products_priced_by_attribute'],
                                    'product_is_free' => $this->products[$i]['product_is_free'],
                                    'products_discount_type' => $this->products[$i]['products_discount_type'],
                                    'products_discount_type_from' => $this->products[$i]['products_discount_type_from'],
                                    'products_prid' => $this->products[$i]['id'],
                                    'products_weight' => (float)$this->products[$i]['weight'],
                                    'products_virtual' => (int)$this->products[$i]['products_virtual'],
                                    'product_is_always_free_shipping' => (int)$this->products[$i]['product_is_always_free_shipping'],
                                    'products_quantity_order_min' => (float)$this->products[$i]['products_quantity_order_min'],
                                    'products_quantity_order_units' => (float)$this->products[$i]['products_quantity_order_units'],
                                    'products_quantity_order_max' => (float)$this->products[$i]['products_quantity_order_max'],
                                    'products_quantity_mixed' => (int)$this->products[$i]['products_quantity_mixed'],
                                    'products_mixed_discount_quantity' => (int)$this->products[$i]['products_mixed_discount_quantity'],
                                    );
            zen_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);
      
      
            $order_products_id = $db->insert_ID();
      
      
            $this->notify('NOTIFY_ORDER_DURING_CREATE_ADDED_PRODUCT_LINE_ITEM', array_merge(array('orders_products_id' => $order_products_id, 'i' => $i), $sql_data_array), $order_products_id);
      
      
            $this->notify('NOTIFY_ORDER_PROCESSING_CREDIT_ACCOUNT_UPDATE_BEGIN');
            $order_total_modules->update_credit_account($i);//ICW ADDED FOR CREDIT CLASS SYSTEM
      
      
            $this->notify('NOTIFY_ORDER_PROCESSING_ATTRIBUTES_BEGIN');
      
      
            //------ bof: insert customer-chosen options to order--------
            $attributes_exist = '0';
            $this->products_ordered_attributes = '';
            if (isset($this->products[$i]['attributes'])) {
              $attributes_exist = '1';
              for ($j=0, $n2=sizeof($this->products[$i]['attributes']); $j<$n2; $j++) {
                if (DOWNLOAD_ENABLED == 'true') {
                  $attributes_query = "select popt.products_options_name, poval.products_options_values_name,
                                       pa.options_values_price, pa.price_prefix,
                                       pa.product_attribute_is_free, pa.products_attributes_weight, pa.products_attributes_weight_prefix,
                                       pa.attributes_discounted, pa.attributes_price_base_included, pa.attributes_price_onetime,
                                       pa.attributes_price_factor, pa.attributes_price_factor_offset,
                                       pa.attributes_price_factor_onetime, pa.attributes_price_factor_onetime_offset,
                                       pa.attributes_qty_prices, pa.attributes_qty_prices_onetime,
                                       pa.attributes_price_words, pa.attributes_price_words_free,
                                       pa.attributes_price_letters, pa.attributes_price_letters_free,
                                       pad.products_attributes_maxdays, pad.products_attributes_maxcount, pad.products_attributes_filename
                                       from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " .
                  TABLE_PRODUCTS_ATTRIBUTES . " pa
                                        left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
                                        on pa.products_attributes_id=pad.products_attributes_id
                                       where pa.products_id = '" . zen_db_input($this->products[$i]['id']) . "'
                                        and pa.options_id = '" . $this->products[$i]['attributes'][$j]['option_id'] . "'
                                        and pa.options_id = popt.products_options_id
                                        and pa.options_values_id = '" . $this->products[$i]['attributes'][$j]['value_id'] . "'
                                        and pa.options_values_id = poval.products_options_values_id
                                        and popt.language_id = '" . $_SESSION['languages_id'] . "'
                                        and poval.language_id = '" . $_SESSION['languages_id'] . "'";
      
      
                  $attributes_values = $db->Execute($attributes_query);
                } else {
                  $attributes_values = $db->Execute("select popt.products_options_name, poval.products_options_values_name,
                                       pa.options_values_price, pa.price_prefix,
                                       pa.product_attribute_is_free, pa.products_attributes_weight, pa.products_attributes_weight_prefix,
                                       pa.attributes_discounted, pa.attributes_price_base_included, pa.attributes_price_onetime,
                                       pa.attributes_price_factor, pa.attributes_price_factor_offset,
                                       pa.attributes_price_factor_onetime, pa.attributes_price_factor_onetime_offset,
                                       pa.attributes_qty_prices, pa.attributes_qty_prices_onetime,
                                       pa.attributes_price_words, pa.attributes_price_words_free,
                                       pa.attributes_price_letters, pa.attributes_price_letters_free
                                       from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
                                       where pa.products_id = '" . $this->products[$i]['id'] . "' and pa.options_id = '" . (int)$this->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . (int)$this->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $_SESSION['languages_id'] . "' and poval.language_id = '" . $_SESSION['languages_id'] . "'");
                }
      
      
                //clr 030714 update insert query.  changing to use values form $order->products for products_options_values.
                $sql_data_array = array('orders_id' => $zf_insert_id,
                                        'orders_products_id' => $order_products_id,
                                        'products_options' => $attributes_values->fields['products_options_name'],
      
      
                //                                 'products_options_values' => $attributes_values->fields['products_options_values_name'],
                                        'products_options_values' => $this->products[$i]['attributes'][$j]['value'],
                                        'options_values_price' => $attributes_values->fields['options_values_price'],
                                        'price_prefix' => $attributes_values->fields['price_prefix'],
                                        'product_attribute_is_free' => $attributes_values->fields['product_attribute_is_free'],
                                        'products_attributes_weight' => $attributes_values->fields['products_attributes_weight'],
                                        'products_attributes_weight_prefix' => $attributes_values->fields['products_attributes_weight_prefix'],
                                        'attributes_discounted' => $attributes_values->fields['attributes_discounted'],
                                        'attributes_price_base_included' => $attributes_values->fields['attributes_price_base_included'],
                                        'attributes_price_onetime' => $attributes_values->fields['attributes_price_onetime'],
                                        'attributes_price_factor' => $attributes_values->fields['attributes_price_factor'],
                                        'attributes_price_factor_offset' => $attributes_values->fields['attributes_price_factor_offset'],
                                        'attributes_price_factor_onetime' => $attributes_values->fields['attributes_price_factor_onetime'],
                                        'attributes_price_factor_onetime_offset' => $attributes_values->fields['attributes_price_factor_onetime_offset'],
                                        'attributes_qty_prices' => $attributes_values->fields['attributes_qty_prices'],
                                        'attributes_qty_prices_onetime' => $attributes_values->fields['attributes_qty_prices_onetime'],
                                        'attributes_price_words' => $attributes_values->fields['attributes_price_words'],
                                        'attributes_price_words_free' => $attributes_values->fields['attributes_price_words_free'],
                                        'attributes_price_letters' => $attributes_values->fields['attributes_price_letters'],
                                        'attributes_price_letters_free' => $attributes_values->fields['attributes_price_letters_free'],
                                        'products_options_id' => (int)$this->products[$i]['attributes'][$j]['option_id'],
                                        'products_options_values_id' => (int)$this->products[$i]['attributes'][$j]['value_id'],
                                        'products_prid' => $this->products[$i]['id']
                                        );
      
      
                zen_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);
                $opa_insert_id = $db->insert_ID();
                $this->notify('NOTIFY_ORDER_DURING_CREATE_ADDED_ATTRIBUTE_LINE_ITEM', array_merge(array('orders_products_attributes_id' => $opa_insert_id), $sql_data_array), $opa_insert_id);
      
      
                if ((DOWNLOAD_ENABLED == 'true') && isset($attributes_values->fields['products_attributes_filename']) && zen_not_null($attributes_values->fields['products_attributes_filename'])) {
                  $sql_data_array = array('orders_id' => $zf_insert_id,
                                          'orders_products_id' => $order_products_id,
                                          'orders_products_filename' => $attributes_values->fields['products_attributes_filename'],
                                          'download_maxdays' => $attributes_values->fields['products_attributes_maxdays'],
                                          'download_count' => $attributes_values->fields['products_attributes_maxcount'],
                                          'products_prid' => $this->products[$i]['id'],
                                          'products_attributes_id' => $opa_insert_id,
                                          );
      
      
                  zen_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);
                  $opd_insert_id = $db->insert_ID();
                  $this->notify('NOTIFY_ORDER_DURING_CREATE_ADDED_ATTRIBUTE_DOWNLOAD_LINE_ITEM', $sql_data_array, $opd_insert_id);
                }
                $this->products_ordered_attributes .= "\n\t" . $attributes_values->fields['products_options_name'] . ' ' . zen_decode_specialchars($this->products[$i]['attributes'][$j]['value']);
              }
            }
            //------eof: insert customer-chosen options ----
          $this->notify('NOTIFY_ORDER_PROCESSING_ATTRIBUTES_EXIST', $attributes_exist);
      
      
          $this->notify('NOTIFY_ORDER_DURING_CREATE_ADD_PRODUCTS', $i, $custom_insertable_text);
      
      
      /* START: ADD MY CUSTOM DETAILS
       * 1. calculate/prepare custom information to be added to this product entry in order-confirmation, perhaps as a function call to custom code to build a serial number etc:
       *   Possible parameters to pass to custom functions at this point:
       *     Product ID ordered (for this line item): $this->products[$i]['id']
       *     Quantity ordered (of this line-item): $this->products[$i]['qty']
       *     Order number: $zf_insert_id
       *     Attribute Option Name ID: (int)$this->products[$i]['attributes'][$j]['option_id']
       *     Attribute Option Value ID: (int)$this->products[$i]['attributes'][$j]['value_id']
       *     Attribute Filename: $attributes_values->fields['products_attributes_filename']
       *
       * 2. Add that data to the $this->products_ordered_attributes variable, using this sort of format:
       *      $this->products_ordered_attributes .=  {INSERT CUSTOM INFORMATION HERE};
       */
      
      
          $this->products_ordered_attributes .= $custom_insertable_text;
      
      
      /* END: ADD MY CUSTOM DETAILS */
      
      
            // update totals counters
            if (!isset($this->total_weight)) $this->total_weight = 0.0;
            if (!isset($this->total_tax)) $this->total_tax = 0.0;
            if (!isset($this->total_cost)) $this->total_cost = 0.0;
            $this->total_weight += ($this->products[$i]['qty'] * $this->products[$i]['weight']);
            $this->total_tax += zen_calculate_tax($this->products[$i]['final_price'] * $this->products[$i]['qty'], $this->products[$i]['tax']);
            $this->total_cost += $this->products[$i]['final_price'] + $this->products[$i]['onetime_charges'];
      
      
            $this->notify('NOTIFY_ORDER_PROCESSING_ONE_TIME_CHARGES_BEGIN', $i);
      
      
            // build output for email notification
            $this->products_ordered .=  $this->products[$i]['qty'] . ' x ' . $this->products[$i]['name'] . ($this->products[$i]['model'] != '' ? ' (' . $this->products[$i]['model'] . ') ' : '') . ' = ' .
            $currencies->display_price($this->products[$i]['final_price'], $this->products[$i]['tax'], $this->products[$i]['qty']) .
            ($this->products[$i]['onetime_charges'] !=0 ? "\n" . TEXT_ONETIME_CHARGES_EMAIL . $currencies->display_price($this->products[$i]['onetime_charges'], $this->products[$i]['tax'], 1) : '') .
            $this->products_ordered_attributes . "\n";
            $this->products_ordered_html .=
            '<tr>' . "\n" .
            '<td class="product-details" align="right" valign="top" width="30">' . $this->products[$i]['qty'] . '&nbsp;x</td>' . "\n" .
            '<td class="product-details" valign="top">' . nl2br($this->products[$i]['name']) . ($this->products[$i]['model'] != '' ? ' (' . nl2br($this->products[$i]['model']) . ') ' : '') . "\n" .
            '<nobr>' .
            '<small><em> '. nl2br($this->products_ordered_attributes) .'</em></small>' .
            '</nobr>' .
            '</td>' . "\n" .
            '<td class="product-details-num" valign="top" align="right">' .
            $currencies->display_price($this->products[$i]['final_price'], $this->products[$i]['tax'], $this->products[$i]['qty']) .
            ($this->products[$i]['onetime_charges'] !=0 ?
            '</td></tr>' . "\n" . '<tr><td class="product-details">' . nl2br(TEXT_ONETIME_CHARGES_EMAIL) . '</td>' . "\n" .
            '<td>' . $currencies->display_price($this->products[$i]['onetime_charges'], $this->products[$i]['tax'], 1) : '') .
            '</td></tr>' . "\n";
          }
      
      
          $order_total_modules->apply_credit();//ICW ADDED FOR CREDIT CLASS SYSTEM
          $this->notify('NOTIFY_ORDER_AFTER_ORDER_CREATE_ADD_PRODUCTS');
        }
      
      
      
      
        function send_order_email($zf_insert_id, $zf_mode = FALSE) {
          global $currencies, $order_totals;
          $this->notify('NOTIFY_ORDER_SEND_EMAIL_INITIALIZE', array(), $zf_insert_id, $order_totals, $zf_mode);
          if (!defined('ORDER_EMAIL_DATE_FORMAT')) define('ORDER_EMAIL_DATE_FORMAT', 'M-d-Y h:iA');
      
      
          $this->send_low_stock_emails = TRUE;
          $this->notify('NOTIFY_ORDER_SEND_LOW_STOCK_EMAILS');
          if ($this->send_low_stock_emails && $this->email_low_stock != ''  && SEND_LOWSTOCK_EMAIL=='1') {
            $email_low_stock = SEND_EXTRA_LOW_STOCK_EMAIL_TITLE . "\n\n" . $this->email_low_stock;
            zen_mail('', SEND_EXTRA_LOW_STOCK_EMAILS_TO, EMAIL_TEXT_SUBJECT_LOWSTOCK, $email_low_stock, STORE_OWNER, EMAIL_FROM, array('EMAIL_MESSAGE_HTML' => nl2br($email_low_stock)),'low_stock');
          }
      
      
          // lets start with the email confirmation
          // make an array to store the html version
          $html_msg=array();
          // COWOA:If COWOA and Send Order Status is True     
      
      
          if ($_SESSION['COWOA'] && (COWOA_ORDER_STATUS == 'true'))  {
          $htmlInvoiceURL=EMAIL_TEXT_INVOICE_URL_CLICK;;
          $htmlInvoiceValue=zen_href_link(FILENAME_ORDER_STATUS, 'order_id=' . $zf_insert_id, 'SSL', false);
          $email_order = EMAIL_TEXT_HEADER . EMAIL_TEXT_FROM . STORE_NAME . "\n\n";
             if ($this->customer['gender'] == "m") {
            $email_order .= EMAIL_GREETING_MR .' ' ;
           } else if ($this->customer['gender'] == "f"){
            $email_order .= EMAIL_GREETING_MS .' ' ;
            } else {
            $email_order .= EMAIL_GREETING_NEUTRAL .' ' ;    
            }
          $email_order .= $this->customer['firstname'] . ' ' . $this->customer['lastname'] . "\n\n" .
          EMAIL_THANKS_FOR_SHOPPING . "\n" . EMAIL_DETAILS_FOLLOW . "\n" .
          EMAIL_SEPARATOR . "\n" .
          EMAIL_TEXT_ORDER_NUMBER . ' ' . $zf_insert_id . "\n" .
          EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n" .
          EMAIL_TEXT_INVOICE_URL . ' ' . zen_href_link(FILENAME_ORDER_STATUS, 'order_id=' . $zf_insert_id, 'SSL', false) . "\n\n";
          $html_msg['EMAIL_TEXT_HEADER']     = EMAIL_TEXT_HEADER;
          $html_msg['EMAIL_TEXT_FROM']       = EMAIL_TEXT_FROM;
          $html_msg['INTRO_STORE_NAME']      = STORE_NAME;
          $html_msg['EMAIL_THANKS_FOR_SHOPPING'] = EMAIL_THANKS_FOR_SHOPPING;
          $html_msg['EMAIL_DETAILS_FOLLOW']  = EMAIL_DETAILS_FOLLOW;
          $html_msg['INTRO_ORDER_NUM_TITLE'] = EMAIL_TEXT_ORDER_NUMBER;
          $html_msg['INTRO_ORDER_NUMBER']    = $zf_insert_id;
          $html_msg['INTRO_DATE_TITLE']      = EMAIL_TEXT_DATE_ORDERED;
          $html_msg['INTRO_DATE_ORDERED']    = strftime(DATE_FORMAT_LONG);
          $html_msg['INTRO_URL_TEXT']        = EMAIL_TEXT_INVOICE_URL_CLICK;
          $html_msg['INTRO_URL_VALUE']       = zen_href_link(FILENAME_ORDER_STATUS, 'order_id=' . $zf_insert_id, 'SSL', false);
          $html_msg['EMAIL_TEXT_TELEPHONE']  = EMAIL_TEXT_TELEPHONE;
          $html_msg['EMAIL_CUSTOMER_PHONE']  = $this->customer['telephone'];
          }
          
          // COWOA:If COWOA but Send Order Status is False
          if ($_SESSION['COWOA'] && (COWOA_ORDER_STATUS == 'false')){
          $htmlInvoiceURL='';
          $htmlInvoiceValue='';
         $email_order = EMAIL_TEXT_HEADER . EMAIL_TEXT_FROM . STORE_NAME . "\n\n";
         if ($this->customer['gender'] == "m") {
            $email_order .= EMAIL_GREETING_MR .' ' ;
           } else if ($this->customer['gender'] == "f"){
            $email_order .= EMAIL_GREETING_MS .' ' ;
            } else {
            $email_order .= EMAIL_GREETING_NEUTRAL .' ' ;    
            }
      
      
          $email_order .= $this->customer['firstname'] . ' ' . $this->customer['lastname'] . "\n\n" .
          EMAIL_THANKS_FOR_SHOPPING . "\n" . EMAIL_DETAILS_FOLLOW . "\n" .
          EMAIL_SEPARATOR . "\n" .
          EMAIL_TEXT_ORDER_NUMBER . ' ' . $zf_insert_id . "\n" .
          EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";
          $html_msg['EMAIL_TEXT_HEADER']     = EMAIL_TEXT_HEADER;
          $html_msg['EMAIL_TEXT_FROM']       = EMAIL_TEXT_FROM;
          $html_msg['INTRO_STORE_NAME']      = STORE_NAME;
          $html_msg['EMAIL_THANKS_FOR_SHOPPING'] = EMAIL_THANKS_FOR_SHOPPING;
          $html_msg['EMAIL_DETAILS_FOLLOW']  = EMAIL_DETAILS_FOLLOW;
          $html_msg['INTRO_ORDER_NUM_TITLE'] = EMAIL_TEXT_ORDER_NUMBER;
          $html_msg['INTRO_ORDER_NUMBER']    = $zf_insert_id;
          $html_msg['INTRO_DATE_TITLE']      = EMAIL_TEXT_DATE_ORDERED;
          $html_msg['INTRO_DATE_ORDERED']    = strftime(DATE_FORMAT_LONG);
          $html_msg['INTRO_URL_TEXT']        = '';
          $html_msg['INTRO_URL_VALUE']       = '';
          $html_msg['EMAIL_TEXT_TELEPHONE']  = EMAIL_TEXT_TELEPHONE;
          $html_msg['EMAIL_CUSTOMER_PHONE']  = $this->customer['telephone'];
          }
          
           // NO COWOA, so lets set up the Text and HTML E-mail Information for the Order History Info
           
           if (!$_SESSION['COWOA']){  
            $invoiceInfo=EMAIL_TEXT_INVOICE_URL . ' ' . zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $zf_insert_id, 'SSL', false) . "\n\n";
            $htmlInvoiceURL=EMAIL_TEXT_INVOICE_URL_CLICK;;
            $htmlInvoiceValue=zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $zf_insert_id, 'SSL', false);
         
          $email_order = EMAIL_TEXT_HEADER . EMAIL_TEXT_FROM . STORE_NAME . "\n\n" ;
             if ($this->customer['gender'] == "m") {
            $email_order .= EMAIL_GREETING_MR .' ' ;
           } else if ($this->customer['gender'] == "f"){
            $email_order .= EMAIL_GREETING_MS .' ' ;
            } else {
            $email_order .= EMAIL_GREETING_NEUTRAL .' ' ;    
            }
      
      
          $email_order .= $this->customer['firstname'] . ' ' . $this->customer['lastname'] . "\n\n" .
          EMAIL_THANKS_FOR_SHOPPING . "\n" . EMAIL_DETAILS_FOLLOW . "\n" .
          EMAIL_SEPARATOR . "\n" .
          EMAIL_TEXT_ORDER_NUMBER . ' ' . $zf_insert_id . "\n" .
          EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n" .
          EMAIL_TEXT_INVOICE_URL . ' ' . zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $zf_insert_id, 'SSL', false) . "\n\n";
      
      
          $html_msg['EMAIL_TEXT_HEADER']     = EMAIL_TEXT_HEADER;
          $html_msg['EMAIL_TEXT_FROM']       = EMAIL_TEXT_FROM;
          $html_msg['INTRO_STORE_NAME']      = STORE_NAME;
          $html_msg['EMAIL_THANKS_FOR_SHOPPING'] = EMAIL_THANKS_FOR_SHOPPING;
          $html_msg['EMAIL_DETAILS_FOLLOW']  = EMAIL_DETAILS_FOLLOW;
          $html_msg['INTRO_ORDER_NUM_TITLE'] = EMAIL_TEXT_ORDER_NUMBER;
          $html_msg['INTRO_ORDER_NUMBER']    = $zf_insert_id;
          $html_msg['INTRO_DATE_TITLE']      = EMAIL_TEXT_DATE_ORDERED;
          $html_msg['INTRO_DATE_ORDERED']    = strftime(DATE_FORMAT_LONG);
          $html_msg['INTRO_URL_TEXT']        = EMAIL_TEXT_INVOICE_URL_CLICK;
          $html_msg['INTRO_URL_VALUE']       = zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $zf_insert_id, 'SSL', false);
          $html_msg['EMAIL_CUSTOMER_PHONE']  = $this->customer['telephone'];
          $html_msg['EMAIL_ORDER_DATE']      = date(ORDER_EMAIL_DATE_FORMAT);
          $html_msg['EMAIL_TEXT_TELEPHONE']  = EMAIL_TEXT_TELEPHONE;
      
      
          $invoiceInfo=EMAIL_TEXT_INVOICE_URL . ' ' . zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $zf_insert_id, 'SSL', false) . "\n\n";
          $htmlInvoiceURL=EMAIL_TEXT_INVOICE_URL_CLICK;
          $htmlInvoiceValue=zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $zf_insert_id, 'SSL', false);
           $email_order = EMAIL_TEXT_HEADER . EMAIL_TEXT_FROM . STORE_NAME . "\n\n" ;
             if ($this->customer['gender'] == "m") {
            $email_order .= EMAIL_GREETING_MR .' ' ;
           } else if ($this->customer['gender'] == "f"){
            $email_order .= EMAIL_GREETING_MS .' ' ;
            } else {
            $email_order .= EMAIL_GREETING_NEUTRAL .' ' ;    
            }
          $email_order .= $this->customer['firstname'] . ' ' . $this->customer['lastname'] . "\n\n" .
            EMAIL_THANKS_FOR_SHOPPING . "\n" . EMAIL_DETAILS_FOLLOW . "\n" .
            EMAIL_SEPARATOR . "\n" .
            EMAIL_TEXT_ORDER_NUMBER . ' ' . $zf_insert_id . "\n" .
            EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n" .
            EMAIL_TEXT_INVOICE_URL . ' ' . zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $zf_insert_id, 'SSL', false) . "\n\n";
      }
          
      
      
      
      
          //comments area
          $html_msg['ORDER_COMMENTS'] = '';
          if ($this->info['comments']) {
            $email_order .= zen_db_output($this->info['comments']) . "\n\n";
            $html_msg['ORDER_COMMENTS'] = nl2br(zen_db_output($this->info['comments']));
          }
      
      
          $this->notify('NOTIFY_ORDER_EMAIL_BEFORE_PRODUCTS', array(), $email_order, $html_msg);
      
      
          //products area
          $email_order .= EMAIL_TEXT_PRODUCTS . "\n" .
          EMAIL_SEPARATOR . "\n" .
          $this->products_ordered .
          EMAIL_SEPARATOR . "\n";
          $html_msg['PRODUCTS_TITLE'] = EMAIL_TEXT_PRODUCTS;
          $html_msg['PRODUCTS_DETAIL']='<table class="product-details" border="0" width="100%" cellspacing="0" cellpadding="2">' . $this->products_ordered_html . '</table>';
      
      
          //order totals area
          $html_ot = '<tr><td class="order-totals-text" align="right" width="100%">' . '&nbsp;' . '</td> ' . "\n" . '<td class="order-totals-num" align="right" nowrap="nowrap">' . '---------' .'</td> </tr>' . "\n";
          for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
            $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";
            $html_ot .= '<tr><td class="order-totals-text" align="right" width="100%">' . $order_totals[$i]['title'] . '</td> ' . "\n" . '<td class="order-totals-num" align="right" nowrap="nowrap">' .($order_totals[$i]['text']) .'</td> </tr>' . "\n";
          }
          $html_msg['ORDER_TOTALS'] = '<table border="0" width="100%" cellspacing="0" cellpadding="2"> ' . $html_ot . ' </table>';
      
      
          //addresses area: Delivery
          $html_msg['HEADING_ADDRESS_INFORMATION']= HEADING_ADDRESS_INFORMATION;
          $html_msg['ADDRESS_DELIVERY_TITLE']     = EMAIL_TEXT_DELIVERY_ADDRESS;
      
      
          $storepickup = (strpos($this->info['shipping_module_code'], "storepickup") !== false); 
          if ($this->content_type != 'virtual' && !$storepickup) {
            $html_msg['ADDRESS_DELIVERY_DETAIL']    = zen_address_label($_SESSION['customer_id'], $_SESSION['sendto'], true, '', "<br />");
          } else {
             $html_msg['ADDRESS_DELIVERY_DETAIL']    = 'n/a'; 
          }
          $html_msg['SHIPPING_METHOD_TITLE']      = HEADING_SHIPPING_METHOD;
          $html_msg['SHIPPING_METHOD_DETAIL']     = (zen_not_null($this->info['shipping_method'])) ? $this->info['shipping_method'] : 'n/a';
      
      
          if ($this->content_type != 'virtual' && !$storepickup) {
            $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" .
            EMAIL_SEPARATOR . "\n" .
            zen_address_label($_SESSION['customer_id'], $_SESSION['sendto'], 0, '', "\n") . "\n";
          }
          $email_order .= EMAIL_TEXT_TELEPHONE . $this->customer['telephone'] . "\n\n";
      
      
          //addresses area: Billing
          $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" .
          EMAIL_SEPARATOR . "\n" .
          zen_address_label($_SESSION['customer_id'], $_SESSION['billto'], 0, '', "\n") . "\n\n";
          $html_msg['ADDRESS_BILLING_TITLE']   = EMAIL_TEXT_BILLING_ADDRESS;
          $html_msg['ADDRESS_BILLING_DETAIL']  = zen_address_label($_SESSION['customer_id'], $_SESSION['billto'], true, '', "<br />");
      
      
          if (is_object($GLOBALS[$_SESSION['payment']])) {
            $cc_num_display = (isset($this->info['cc_number']) && $this->info['cc_number'] != '') ? /*substr($this->info['cc_number'], 0, 4) . */ str_repeat('X', (strlen($this->info['cc_number']) - 8)) . substr($this->info['cc_number'], -4) . "\n\n" : '';
            $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" .
            EMAIL_SEPARATOR . "\n";
            $payment_class = $_SESSION['payment'];
            $email_order .= $GLOBALS[$payment_class]->title . "\n\n";
            $email_order .= (isset($this->info['cc_type']) && $this->info['cc_type'] != '') ? $this->info['cc_type'] . ' ' . $cc_num_display . "\n\n" : '';
            $email_order .= (isset($GLOBALS[$payment_class]->email_footer) && $GLOBALS[$payment_class]->email_footer) ? $GLOBALS[$payment_class]->email_footer . "\n\n" : '';
          } else {
            $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" .
            EMAIL_SEPARATOR . "\n";
            $email_order .= PAYMENT_METHOD_GV . "\n\n";
          }
          $html_msg['PAYMENT_METHOD_TITLE']  = EMAIL_TEXT_PAYMENT_METHOD;
          $html_msg['PAYMENT_METHOD_DETAIL'] = (isset($GLOBALS[$_SESSION['payment']]) && is_object($GLOBALS[$_SESSION['payment']]) ? $GLOBALS[$payment_class]->title : PAYMENT_METHOD_GV );
          $html_msg['PAYMENT_METHOD_FOOTER'] = (isset($GLOBALS[$payment_class]->email_footer) && is_object($GLOBALS[$_SESSION['payment']]) && $GLOBALS[$payment_class]->email_footer != '') ? nl2br($GLOBALS[$payment_class]->email_footer) : (isset($this->info['cc_type']) && $this->info['cc_type'] != '' ? $this->info['cc_type'] . ' ' . $cc_num_display . "\n\n" : '');
      
      
          // Add in store specific order message
          $this->email_order_message = defined('EMAIL_ORDER_MESSAGE') ? constant('EMAIL_ORDER_MESSAGE') : '';
          $this->notify('NOTIFY_ORDER_SET_ORDER_MESSAGE');
          if (!empty($this->email_order_message)) {
            $email_order .= "\n\n" . $this->email_order_message . "\n\n";
          }
          $html_msg['EMAIL_ORDER_MESSAGE'] = $this->email_order_message;
      
      
          // include disclaimer
          if (defined('EMAIL_DISCLAIMER') && EMAIL_DISCLAIMER != '') $email_order .= "\n-----\n" . sprintf(EMAIL_DISCLAIMER, STORE_OWNER_EMAIL_ADDRESS) . "\n\n";
          // include copyright
          if (defined('EMAIL_FOOTER_COPYRIGHT')) $email_order .= "\n-----\n" . EMAIL_FOOTER_COPYRIGHT . "\n\n";
      
      
          $email_order = str_replace('&nbsp;', ' ', $email_order);
      
      
          if ($this->customer['gender'] == "m") {
           $html_msg['EMAIL_GREETING'] = EMAIL_GREETING_MR;
           } else if ($this->customer['gender'] == "f"){
            $html_msg['EMAIL_GREETING'] = EMAIL_GREETING_MS;
            } else {
            $html_msg['EMAIL_GREETING'] = EMAIL_GREETING_NEUTRAL;    
            }
          $html_msg['EMAIL_FIRST_NAME'] = $this->customer['firstname'];
          $html_msg['EMAIL_LAST_NAME'] = $this->customer['lastname'];
          //  $html_msg['EMAIL_TEXT_HEADER'] = EMAIL_TEXT_HEADER;
          $html_msg['EXTRA_INFO'] = '';
          $this->notify('NOTIFY_ORDER_INVOICE_CONTENT_READY_TO_SEND', array('zf_insert_id' => $zf_insert_id, 'text_email' => $email_order, 'html_email' => $html_msg), $email_order, $html_msg);
      
      
          // BOF pdf Rechnung
          if(RL_INVOICE3_STATUS=='true'){
          $this->attachArray = array();
          if(RL_INVOICE3_SEND_PDF=='1'){
              if(!(0==$this->info['total'] && RL_INVOICE3_NOT_NULL_INVOICE==0)){     
                  if( (defined('RL_INVOICE3_ORDERSTATUS')) && ($this->info['order_status'] >= RL_INVOICE3_ORDERSTATUS)) {
                      require_once(DIR_WS_INCLUDES . 'classes/class.rl_invoice3.php');
                      
                      $pdfT = new rl_invoice3($zf_insert_id, $paper['orientation'], $paper['unit'], $paper['format']);
                      $pdfT -> createPdfFile(true);
                      $this->attachArray = $pdfT->getPDFAttachments();
                      
                  }
              }
          }
        } 
        // EOF pdf Rechnung
          zen_mail($this->customer['firstname'] . ' ' . $this->customer['lastname'], $this->customer['email_address'], EMAIL_TEXT_SUBJECT . EMAIL_ORDER_NUMBER_SUBJECT . $zf_insert_id, $email_order, STORE_NAME, EMAIL_FROM, $html_msg, 'checkout', $this->attachArray);
      
      
          
          // send additional emails
          if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
            $extra_info = email_collect_extra_info('', '', $this->customer['firstname'] . ' ' . $this->customer['lastname'], $this->customer['email_address'], $this->customer['telephone']);
            $html_msg['EXTRA_INFO'] = $extra_info['HTML'];
      
      
            // include authcode and transaction id in admin-copy of email
            $payment_auth_code = !empty($GLOBALS[$_SESSION['payment']]->auth_code) ? $GLOBALS[$_SESSION['payment']]->auth_code : '';
            $payment_transaction_id = !empty($GLOBALS[$_SESSION['payment']]->transaction_id) ? $GLOBALS[$_SESSION['payment']]->transaction_id : '';
            if ($payment_auth_code !== '' || $payment_transaction_id !== '') {
              $pmt_details = ($payment_auth_code != '' ? 'AuthCode: ' . $payment_auth_code . '  ' : '') . ($payment_transaction_id != '' ?  'TransID: ' . $payment_transaction_id : '') . "\n\n";
              $email_order = $pmt_details . $email_order;
              $html_msg['EMAIL_TEXT_HEADER'] = nl2br($pmt_details) . $html_msg['EMAIL_TEXT_HEADER'];
            }
      
      
            // Add extra heading stuff via observer class
            $this->extra_header_text = '';
            $this->notify('NOTIFY_ORDER_INVOICE_CONTENT_FOR_ADDITIONAL_EMAILS', $zf_insert_id, $email_order, $html_msg);
            $email_order = $this->extra_header_text . $email_order;
            $html_msg['EMAIL_TEXT_HEADER'] = nl2br($this->extra_header_text) . $html_msg['EMAIL_TEXT_HEADER'];
            // BOF pdf Rechnung
            if(RL_INVOICE3_STATUS=='true'){
            if(method_exists($pdfT, "getPDFAttachments")){
              $this->attachArray = $pdfT->getPDFAttachments('NO');
            }
          }
          // EOF pdf Rechnung
            zen_mail('', SEND_EXTRA_ORDER_EMAILS_TO, SEND_EXTRA_NEW_ORDERS_EMAILS_TO_SUBJECT . ' ' . EMAIL_TEXT_SUBJECT . EMAIL_ORDER_NUMBER_SUBJECT . $zf_insert_id,
            $email_order . $extra_info['TEXT'], STORE_NAME, EMAIL_FROM, $html_msg, 'checkout_extra', $this->attachArray, $this->customer['firstname'] . ' ' . $this->customer['lastname'], $this->customer['email_address']);
          }
          $this->notify('NOTIFY_ORDER_AFTER_SEND_ORDER_EMAIL', $zf_insert_id, $email_order, $extra_info, $html_msg);
        }
      
      
      // bof UID
      function zen_get_country_geo_zone_id($country_id){
        global $db;
        $country_geo_zone_query = "select geo_zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where zone_country_id = '" . (int)$country_id . "' limit 1";
        $country_geo_zone_id = $db->Execute($country_geo_zone_query);
      return $country_geo_zone_id->fields['geo_zone_id'];
      }
      
      
      function zen_tva_geo_tax($tax_country_id, $billing_company, $billing_tva_intracom){
        $tax_geo_zone_id = $this->zen_get_country_geo_zone_id($tax_country_id);
        if($tax_country_id == STORE_COUNTRY ) return true; // store
        if($tax_geo_zone_id == 0) return true; // no geo-zone
        if($tax_geo_zone_id != 0 && !$billing_tva_intracom) return true; // geo-zone & no vat
        elseif(!$billing_company && !$billing_tva_intracom) return false; // no vat
        else return false;
      }
      // eof UID
      
      }


      2.) includes/modules/pages/checkout_confirmation/header_php.php

      Code:
      <?php/**
       * checkout_confirmation header_php.php
       *
       * @package page
       * @copyright Copyright 2003-2019 Zen Cart Development Team
       * @copyright Portions Copyright 2003 osCommerce
       * @license https://www.zen-cart-pro.at/license/3_0.txt GNU General Public License V3.0
       * @version $Id: header_php.php for Datenweitergabe an Versandunternehmen 2019-11-08 19:05:16Z webchills $
       */
      
      
      // This should be first line of the script:
      $zco_notifier->notify('NOTIFY_HEADER_START_CHECKOUT_CONFIRMATION');
      
      
      // if there is nothing in the customers cart, redirect them to the shopping cart page
      if ($_SESSION['cart']->count_contents() <= 0) {
          zen_redirect(zen_href_link(FILENAME_TIME_OUT));
      }
      
      
      // if the customer is not logged on, redirect them to the login page
        if (!zen_is_logged_in()) {
          $_SESSION['navigation']->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT));
          zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
        } else {
          // validate customer
          if (zen_get_customer_validate_session($_SESSION['customer_id']) == false) {
            $_SESSION['navigation']->set_snapshot();
            zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
          }
        }
      
      
      // avoid hack attempts during the checkout procedure by checking the internal cartID
      if (isset($_SESSION['cart']->cartID) && $_SESSION['cartID']) {
        if ($_SESSION['cart']->cartID != $_SESSION['cartID']) {
          zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
        }
      }
      
      
      // if no shipping method has been selected, redirect the customer to the shipping method selection page
      if (!isset($_SESSION['shipping'])) {
        zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
      }
      if (isset($_SESSION['shipping']['id']) && $_SESSION['shipping']['id'] == 'free_free' && $_SESSION['cart']->get_content_type() != 'virtual' && defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true' && defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER') && $_SESSION['cart']->show_total() < MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) {
        zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
      }
      
      
      if (isset($_POST['payment'])) $_SESSION['payment'] = $_POST['payment'];
      
      
      $_SESSION['comments'] = zen_output_string_protected($_POST['comments']);
      $_SESSION['carrier'] = zen_db_prepare_input($_POST['carrier']);
      
      
      //'checkout_payment_discounts'
      //zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
      
      
      
      
      if (DISPLAY_CONDITIONS_ON_CHECKOUT == 'true') {
        if (!isset($_POST['conditions']) || ($_POST['conditions'] != '1')) {
          $messageStack->add_session('checkout_payment', ERROR_CONDITIONS_NOT_ACCEPTED, 'error');
        }
      }
      
      
      if (($_SESSION['cart']->get_content_type() == 'virtual') || (bool)preg_match('#storepickup#i', $_SESSION['shipping']['id'])) {
            //
            } else {
        if (!isset($_POST['carrier']))  {
          $messageStack->add_session('checkout_payment', ERROR_CARRIER_NOT_ACCEPTED, 'error');
        }
      }
      //echo $messageStack->size('checkout_payment');
      
      
      require(DIR_WS_CLASSES . 'order.php');
      $order = new order;
      // load the selected shipping module
      require(DIR_WS_CLASSES . 'shipping.php');
      $shipping_modules = new shipping($_SESSION['shipping']);
      
      
      
      
      require(DIR_WS_CLASSES . 'order_total.php');
      $order_total_modules = new order_total;
      $order_total_modules->collect_posts();
      $order_total_modules->pre_confirmation_check();
      
      
      // load the selected payment module
      require(DIR_WS_CLASSES . 'payment.php');
      
      
      if (!isset($credit_covers)) $credit_covers = FALSE;
      
      
      //echo 'credit covers'.$credit_covers;
      
      
      if ($credit_covers) {
        unset($_SESSION['payment']);
        $_SESSION['payment'] = '';
      }
      
      
      //@debug echo ($credit_covers == true) ? 'TRUE' : 'FALSE';
      
      
      $payment_modules = new payment($_SESSION['payment']);
      $payment_modules->update_status();
      if ( ($_SESSION['payment'] == '' || !is_object(${$_SESSION['payment']}) ) && $credit_covers === FALSE) {
        $messageStack->add_session('checkout_payment', ERROR_NO_PAYMENT_MODULE_SELECTED, 'error');
      }
      
      
      if (is_array($payment_modules->modules)) {
        $payment_modules->pre_confirmation_check();
      }
      
      
      if ($messageStack->size('checkout_payment') > 0) {
        zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
      }
      
      
      // Stock Check
      $flagAnyOutOfStock = false;
      $stock_check = array();
      if (STOCK_CHECK == 'true') {
        for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
          if ($stock_check[$i] = zen_check_stock($order->products[$i]['id'], $order->products[$i]['qty'])) {
            $flagAnyOutOfStock = true;
          }
        }
        // Out of Stock
        if ( (STOCK_ALLOW_CHECKOUT != 'true') && ($flagAnyOutOfStock == true) ) {
          zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
        }
      }
      
      
      // update customers_referral with $_SESSION['gv_id']
      if (!empty($_SESSION['cc_id'])) {
        $discount_coupon_query = "SELECT coupon_code
                                  FROM " . TABLE_COUPONS . "
                                  WHERE coupon_id = :couponID";
      
      
        $discount_coupon_query = $db->bindVars($discount_coupon_query, ':couponID', $_SESSION['cc_id'], 'integer');
        $discount_coupon = $db->Execute($discount_coupon_query);
      
      
        $customers_referral_query = "SELECT customers_referral
                                     FROM " . TABLE_CUSTOMERS . "
                                     WHERE customers_id = :customersID";
      
      
        $customers_referral_query = $db->bindVars($customers_referral_query, ':customersID', $_SESSION['customer_id'], 'integer');
        $customers_referral = $db->Execute($customers_referral_query);
      
      
        // only use discount coupon if set by coupon
        if ($customers_referral->fields['customers_referral'] == '' and CUSTOMERS_REFERRAL_STATUS == 1) {
          $sql = "UPDATE " . TABLE_CUSTOMERS . "
                  SET customers_referral = :customersReferral
                  WHERE customers_id = :customersID";
      
      
          $sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer');
          $sql = $db->bindVars($sql, ':customersReferral', $discount_coupon->fields['coupon_code'], 'string');
          $db->Execute($sql);
        } else {
          // do not update referral was added before
        }
      }
      
      
      if (isset(${$_SESSION['payment']}->form_action_url)) {
        $form_action_url = ${$_SESSION['payment']}->form_action_url;
      } else {
        $form_action_url = zen_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL');
      }
      
      
      // if shipping-edit button should be overridden, do so
      $editShippingButtonLink = zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL');
      if (method_exists(${$_SESSION['payment']}, 'alterShippingEditButton')) {
        $theLink = ${$_SESSION['payment']}->alterShippingEditButton();
        if ($theLink) $editShippingButtonLink = $theLink;
      }
      // deal with billing address edit button
      $flagDisablePaymentAddressChange = false;
      if (isset(${$_SESSION['payment']}->flagDisablePaymentAddressChange)) {
        $flagDisablePaymentAddressChange = ${$_SESSION['payment']}->flagDisablePaymentAddressChange;
      }
      
      
      
      
      require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
      $breadcrumb->add(NAVBAR_TITLE_1, zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
      $breadcrumb->add(NAVBAR_TITLE_2);
      
      
      // This should be last line of the script:
      $zco_notifier->notify('NOTIFY_HEADER_END_CHECKOUT_CONFIRMATION');


      3.) includes/templates/DEINTEMPLATE/templates/tpl_checkout_confirmation_default.php

      Code:
      <?php/**
       * Page Template
       *
       * Loaded automatically by index.php?main_page=checkout_confirmation.<br />
       * Displays final checkout details, cart, payment and shipping info details.
       *
       * @package templateSystem
       * @copyright Copyright 2003-2019 Zen Cart Development Team
       * @copyright Portions Copyright 2003 osCommerce
       * @license https://www.zen-cart-pro.at/license/3_0.txt GNU General Public License V3.0
       * @version $Id: tpl_checkout_confirmation_default.php 2016-04-06 12:57:16Z webchills $
       */
      ?>
      <div class="centerColumn" id="checkoutConfirmDefault">
      
      
      <h1 id="checkoutConfirmDefaultHeading"><?php echo HEADING_TITLE; ?></h1>
      <div id="conditionslaststep"><?php echo TEXT_ZUSATZ_SCHRITT3; ?><br/><?php echo TEXT_CONDITIONS_ACCEPTED_IN_LAST_STEP; ?></div>
      
      
      <?php if ($messageStack->size('redemptions') > 0) echo $messageStack->output('redemptions'); ?>
      <?php if ($messageStack->size('checkout_confirmation') > 0) echo $messageStack->output('checkout_confirmation'); ?>
      <?php if ($messageStack->size('checkout') > 0) echo $messageStack->output('checkout'); ?>
      
      
      <div id="checkoutBillto" class="back">
      <h2 id="checkoutConfirmDefaultBillingAddress"><?php echo HEADING_BILLING_ADDRESS; ?></h2>
      <?php if (!$flagDisablePaymentAddressChange) { ?>
      <div class="buttonRow forward"><?php echo '<a href="' . zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_EDIT_SMALL, BUTTON_EDIT_SMALL_ALT) . '</a>'; ?></div>
      <?php } ?>
      
      
      <address><?php echo zen_address_format($order->billing['format_id'], $order->billing, 1, ' ', '<br />'); ?></address>
      
      
      <?php
        $class =& $_SESSION['payment'];
      ?>
      
      
      <h3 id="checkoutConfirmDefaultPayment"><?php echo HEADING_PAYMENT_METHOD; ?></h3> 
      <h4 id="checkoutConfirmDefaultPaymentTitle"><?php echo $GLOBALS[$class]->title; ?></h4>
      
      
      <?php
        if (is_array($payment_modules->modules)) {
          if ($confirmation = $payment_modules->confirmation()) {
      ?>
      <div class="important"><?php echo $confirmation['title']; ?></div>
      <?php
          }
      ?>
      <div class="important">
      <?php
            for ($i=0, $n=sizeof($confirmation['fields']); $i<$n; $i++) {
      ?>
      <div class="back"><?php echo $confirmation['fields'][$i]['title']; ?></div>
      <div ><?php echo $confirmation['fields'][$i]['field']; ?></div>
      <?php
           }
      ?>
            </div>
      <?php
        }
      ?>
      
      
      <br class="clearBoth" />
      </div>
      
      
      <?php
        if ($_SESSION['sendto'] != false) {
      ?>
      <div id="checkoutShipto" class="forward">
      <h2 id="checkoutConfirmDefaultShippingAddress"><?php echo HEADING_DELIVERY_ADDRESS; ?></h2>
      <div class="buttonRow forward"><?php echo '<a href="' . $editShippingButtonLink . '">' . zen_image_button(BUTTON_IMAGE_EDIT_SMALL, BUTTON_EDIT_SMALL_ALT) . '</a>'; ?></div>
      
      
      <address><?php echo zen_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br />'); ?></address>
      
      
      <?php
          if ($order->info['shipping_method']) {
      ?>
      <h3 id="checkoutConfirmDefaultShipment"><?php echo HEADING_SHIPPING_METHOD; ?></h3>
      <h4 id="checkoutConfirmDefaultShipmentTitle"><?php echo $order->info['shipping_method']; ?></h4>
      
      
      <?php
          }
      ?>
      </div>
      <?php
        }
      ?>
      <br class="clearBoth" />
      <hr />
      
      
      <h2 id="checkoutConfirmDefaultHeadingComments"><?php echo HEADING_ORDER_COMMENTS; ?></h2>
      <div class="buttonRow forward"><?php echo  '<a href="' . zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_EDIT_SMALL, BUTTON_EDIT_SMALL_ALT) . '</a>'; ?></div>
      <div><?php echo (empty($order->info['comments']) ? NO_COMMENTS_TEXT : nl2br(zen_output_string_protected($order->info['comments'])) . zen_draw_hidden_field('comments', $order->info['comments'])); ?></div>
      <br class="clearBoth" />
      <hr />
      <div id="cartandsum">
      <h2 id="checkoutConfirmDefaultHeadingCart"><?php echo HEADING_PRODUCTS; ?></h2>
      
      
      <div class="buttonRow forward"><?php echo '<a href="' . zen_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_EDIT_SMALL, BUTTON_EDIT_SMALL_ALT) . '</a>'; ?></div>
      <br class="clearBoth" />
      
      
      <?php  if ($flagAnyOutOfStock) { ?>
      <?php    if (STOCK_ALLOW_CHECKOUT == 'true') {  ?>
      <div class="messageStackError"><?php echo OUT_OF_STOCK_CAN_CHECKOUT; ?></div>
      <?php    } else { ?>
      <div class="messageStackError"><?php echo OUT_OF_STOCK_CANT_CHECKOUT; ?></div>
      <?php    } //endif STOCK_ALLOW_CHECKOUT ?>
      <?php  } //endif flagAnyOutOfStock ?>
      
      
      
      
            <table id="cartContentsDisplay">
              <tr class="cartTableHeading">
              <th scope="col" id="ccQuantityHeading"><?php echo TABLE_HEADING_QUANTITY; ?></th>
              <th scope="col" id="ccProductsHeading"><?php echo TABLE_HEADING_PRODUCTS; ?></th>
              
              <th scope="col" id="ccProductsHeading"><?php echo TABLE_HEADING_PRODUCTIMAGE; ?></th>
              
      <?php
        // If there are tax groups, display the tax columns for price breakdown
        if (sizeof($order->info['tax_groups']) > 1) {
      ?>
                <th scope="col" id="ccTaxHeading"><?php echo HEADING_TAX; ?></th>
      <?php
        }
      ?>
      
      
       <th scope="col" id="ccSinglePriceHeading"><?php echo TABLE_HEADING_SINGLEPRICE; ?></th>
      
      
                <th scope="col" id="ccTotalHeading"><?php echo TABLE_HEADING_TOTAL; ?></th>
              </tr>
      <?php // now loop thru all products to display quantity and price ?>
      <?php for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { ?>
              <tr class="<?php echo $order->products[$i]['rowClass']; ?>">
                <td  class="cartQuantity"><?php echo $order->products[$i]['qty']; ?>&nbsp;x</td>
                <td class="cartProductDisplay"><?php echo $order->products[$i]['name']; ?>
                    
      
      
                    <br/><?php echo $order->products[$i]['merkmale']; ?>
             
      
      
                <?php  echo $stock_check[$i]; ?>
      
      
      <?php // if there are attributes, loop thru them and display one per line
          if (isset($order->products[$i]['attributes']) && sizeof($order->products[$i]['attributes']) > 0 ) {
          echo '<ul class="cartAttribsList">';
            for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
      ?>
            <li><?php echo $order->products[$i]['attributes'][$j]['option'] . ': ' . nl2br(zen_output_string_protected($order->products[$i]['attributes'][$j]['value'])); ?></li>
      <?php
            } // end loop
            echo '</ul>';
          } // endif attribute-info
      ?>
              </td>
              
              <td class="cartProductImg">
      <?php echo zen_image(DIR_WS_IMAGES . $order->products[$i]['image'], $order->products[$i]['name'], IMAGE_SHOPPING_CART_WIDTH, IMAGE_SHOPPING_CART_HEIGHT);?>
       </td>
      
      
      
      
      <?php // display tax info if exists ?>
      <?php if (sizeof($order->info['tax_groups']) > 1)  { ?>
              <td class="cartTotalDisplay">
                <?php echo zen_display_tax_value($order->products[$i]['tax']); ?>%</td>
      <?php    }  // endif tax info display  ?>
              
              <td class="cartTotalDisplay">
                <?php echo $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], 1);?>
               
       </td>
      
      
              <td class="cartTotalDisplay" valign="top">
                <?php echo $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']);
                if ($order->products[$i]['onetime_charges'] != 0 ) echo '<br /> ' . $currencies->display_price($order->products[$i]['onetime_charges'], $order->products[$i]['tax'], 1);
      ?>
              </td>
            </tr>
      <?php  }  // end for loopthru all products ?>
            </table>
            <hr />
      
      
      <?php
        if (MODULE_ORDER_TOTAL_INSTALLED) {
          $order_totals = $order_total_modules->process();
      ?>
      <div id="orderTotals"><?php $order_total_modules->output(); ?></div>
      <?php
        }
      ?>
      
      
      <?php
        echo zen_draw_form('checkout_confirmation', $form_action_url, 'post', 'id="checkout_confirmation" onsubmit="submitonce();"');
      
      
        if (is_array($payment_modules->modules)) {
          echo $payment_modules->process_button();
        }
      ?>
      
      
      <?php
       // zollhinweis für nicht EU
              $dest_country = isset ($order->delivery['country']['iso_code_2']) ? $order->delivery['country']['iso_code_2'] : 0 ;
              $dest_zone = 0;
              $error = false;
              $countries_table = EU_COUNTRIES_FOR_LAST_STEP; 
              $country_zones = explode(",", $countries_table);
              if ((!in_array($dest_country, $country_zones))&& ($order->delivery['country']['id'] != '')) {
                  $dest_zone = $i;
                  echo TEXT_NON_EU_COUNTRIES;
              } else {
                  // do nothing
              }
              ?>
      
      
      </div>
      <?php
        if (DISPLAY_WIDERRUF_DOWNLOADS_ON_CHECKOUT_CONFIRMATION == 'true') {
      ?>
      <fieldset>
      <legend><?php echo HEADING_WIDERRUF_DOWNLOADS; ?></legend>
      <?php echo  zen_draw_checkbox_field('widerruf_downloads', '1', false, 'id="widerruf_downloads"');?>
      <label class="checkboxLabel" for="widerruf_downloads"><?php echo TEXT_WIDERRUF_DOWNLOADS_CONFIRM; ?></label>
      </fieldset>
      <?php
        }
      ?>
      <div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_CONFIRM_ORDER, BUTTON_CONFIRM_ORDER_ALT, 'name="btn_submit" id="btn_submit"') ;?></div>
      </form>
      
      
      
      
      
      </div>


      Hoffe ist alles komplett. Danke schon mal im voraus.

      Liebe Grüße

      Kräuterhexe


      Kommentar


        #4
        Danke, kannst Du bitte noch folgende Datei posten?
        includes/templates/DEINTEMPLATE/templates/tpl_checkout_payment_default.php

        Kommentar


          #5
          Mach ich doch gerne

          Hier noch die 4. Datei.

          4.) includes/templates/DEINTEMPLATE/templates/tpl_checkout_payment_default.php

          Code:
          <?php/**
           * Page Template
           *
           * Loaded automatically by index.php?main_page=checkout_payment.<br />
           * Displays the allowed payment modules, for selection by customer.
           *
           * @package templateSystem
           * @copyright Copyright 2003-2019 Zen Cart Development Team
           * @copyright Portions Copyright 2003 osCommerce
           * @license https://www.zen-cart-pro.at/license/3_0.txt GNU General Public License V3.0
           * @version $Id: tpl_checkout_payment_default.php for COWOA 2019-11-02 16:59:42Z webchills $
           * @version $Id: tpl_checkout_payment_default.php for Datenweitergabe an Transportunternehmen 2019-11-08 19:42:42Z webchills $
           */
          ?>
          <?php echo $payment_modules->javascript_validation(); ?>
          <div class="centerColumn" id="checkoutPayment">
          <?php echo zen_draw_form('checkout_payment', zen_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post'); ?>
          <?php echo zen_draw_hidden_field('action', 'submit'); ?>
          
          
          <h1 id="checkoutPaymentHeading"><?php echo HEADING_TITLE; ?></h1>
          
          
          <?php if ($messageStack->size('redemptions') > 0) echo $messageStack->output('redemptions'); ?>
          <?php if ($messageStack->size('checkout') > 0) echo $messageStack->output('checkout'); ?>
          <?php if ($messageStack->size('checkout_payment') > 0) echo $messageStack->output('checkout_payment'); ?>
          
          
          
          
          <?php // ** BEGIN PAYPAL EXPRESS CHECKOUT **
                if (!$payment_modules->in_special_checkout()) {
                // ** END PAYPAL EXPRESS CHECKOUT ** ?>
          <h2 id="checkoutPaymentHeadingAddress"><?php echo TITLE_BILLING_ADDRESS; ?></h2>
          
          
          <div id="checkoutBillto" class="floatingBox back">
          <?php if (MAX_ADDRESS_BOOK_ENTRIES >= 2) { ?>
          <div class="buttonRow forward"><?php echo '<a href="' . zen_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_CHANGE_ADDRESS, BUTTON_CHANGE_ADDRESS_ALT) . '</a>'; ?></div>
          <?php } ?>
          <address><?php echo zen_address_label($_SESSION['customer_id'], $_SESSION['billto'], true, ' ', '<br />'); ?></address>
          </div>
          
          
          <div class="floatingBox important forward"><?php echo TEXT_SELECTED_BILLING_DESTINATION; ?></div>
          <br class="clearBoth" />
          <br />
          <?php // ** BEGIN PAYPAL EXPRESS CHECKOUT **
                }
                // ** END PAYPAL EXPRESS CHECKOUT ** ?>
                
          <fieldset id="checkoutOrderTotals">
          <legend id="checkoutPaymentHeadingTotal"><?php echo TEXT_YOUR_TOTAL; ?></legend>
          <?php
            if (MODULE_ORDER_TOTAL_INSTALLED) {
              $order_totals = $order_total_modules->process();
          ?>
          <?php $order_total_modules->output(); ?>
          <?php
            }
          ?>
          </fieldset>
          
          
          <?php
            $selection =  $order_total_modules->credit_selection();
            if (sizeof($selection)>0) {
              for ($i=0, $n=sizeof($selection); $i<$n; $i++) {
                if (isset($_GET['credit_class_error_code']) && ($_GET['credit_class_error_code'] == (isset($selection[$i]['id'])) ? $selection[$i]['id'] : 0)) {
          ?>
          <div class="messageStackError"><?php echo zen_output_string_protected($_GET['credit_class_error']); ?></div>
          
          
          <?php
                }
                for ($j=0, $n2=(isset($selection[$i]['fields']) ? sizeof($selection[$i]['fields']) : 0); $j<$n2; $j++) {
          ?>
          <?php if(!($COWOA)) {?>
          <fieldset>
          <legend><?php echo $selection[$i]['module']; ?></legend>
          <?php echo $selection[$i]['redeem_instructions']; ?>
          <div class="gvBal larger"><?php echo (isset($selection[$i]['checkbox'])) ? $selection[$i]['checkbox'] : ''; ?></div>
          <label class="inputLabel"<?php echo ($selection[$i]['fields'][$j]['tag']) ? ' for="'.$selection[$i]['fields'][$j]['tag'].'"': ''; ?>><?php echo $selection[$i]['fields'][$j]['title']; ?></label>
          <?php echo $selection[$i]['fields'][$j]['field']; ?>
          </fieldset>
            <?php } ?>
          <?php
                }
              }
          ?>
          
          
          <?php
              }
          ?>
          
          
          <?php // ** BEGIN PAYPAL EXPRESS CHECKOUT **
                if (!$payment_modules->in_special_checkout()) {
                // ** END PAYPAL EXPRESS CHECKOUT ** ?>
          <fieldset class="payment">
          <legend><?php echo TABLE_HEADING_PAYMENT_METHOD; ?></legend>
          
          
          <?php
            if (SHOW_ACCEPTED_CREDIT_CARDS != '0') {
          ?>
          
          
          <?php
              if (SHOW_ACCEPTED_CREDIT_CARDS == '1') {
                echo TEXT_ACCEPTED_CREDIT_CARDS . zen_get_cc_enabled();
              }
              if (SHOW_ACCEPTED_CREDIT_CARDS == '2') {
                echo TEXT_ACCEPTED_CREDIT_CARDS . zen_get_cc_enabled('IMAGE_');
              }
          ?>
          <br class="clearBoth" />
          <?php } ?>
          
          
          <?php
            $selection = $payment_modules->selection();
          
          
            if (sizeof($selection) > 1) {
          ?>
          <p class="important"><?php echo TEXT_SELECT_PAYMENT_METHOD; ?></p>
          <?php
            } elseif (sizeof($selection) == 0) {
          ?>
          <p class="important"><?php echo TEXT_NO_PAYMENT_OPTIONS_AVAILABLE; ?></p>
          
          
          <?php
            }
          ?>
          
          
          <?php
            $radio_buttons = 0;
            for ($i=0, $n=sizeof($selection); $i<$n; $i++) {
          ?>
          <?php
              if (sizeof($selection) > 1) {
                  if (empty($selection[$i]['noradio'])) {
           ?>
          <?php echo zen_draw_radio_field('payment', $selection[$i]['id'], ($selection[$i]['id'] == $_SESSION['payment'] ? true : false), 'id="pmt-'.$selection[$i]['id'].'"'); ?>
          <?php   } ?>
          <?php
              } else {
          
          
          ?>
          <?php echo zen_draw_hidden_field('payment', $selection[$i]['id'], 'id="pmt-'.$selection[$i]['id'].'"'); ?>
          <?php
              }
          ?>
          <label for="pmt-<?php echo $selection[$i]['id']; ?>" class="radioButtonLabel"><?php echo $selection[$i]['module']; ?></label>
          
          
          <?php
              if (defined('MODULE_ORDER_TOTAL_COD_STATUS') && MODULE_ORDER_TOTAL_COD_STATUS == 'true' and $selection[$i]['id'] == 'cod') {
          ?>
          <div class="alert"><?php echo TEXT_INFO_COD_FEES; ?></div>
          <?php
              } else {
                // echo 'WRONG ' . $selection[$i]['id'];
          ?>
          <?php
              }
          ?>
          <br class="clearBoth" />
          
          
          <?php
              if (isset($selection[$i]['error'])) {
          ?>
              <div><?php echo $selection[$i]['error']; ?></div>
          
          
          <?php
              } elseif (isset($selection[$i]['fields']) && is_array($selection[$i]['fields'])) {
          ?>
          
          
          <div class="ccinfo">
          <?php
                for ($j=0, $n2=sizeof($selection[$i]['fields']); $j<$n2; $j++) {
          ?>
          <label <?php echo (isset($selection[$i]['fields'][$j]['tag']) ? 'for="'.$selection[$i]['fields'][$j]['tag'] . '" ' : ''); ?>class="inputLabelPayment"><?php echo $selection[$i]['fields'][$j]['title']; ?></label><?php echo $selection[$i]['fields'][$j]['field']; ?>
          <br class="clearBoth" />
          <?php
                }
          ?>
          </div>
          <br class="clearBoth" />
          <?php
              }
              $radio_buttons++;
          ?>
          <br class="clearBoth" />
          <?php
            }
          ?>
          
          
          </fieldset>
          <?php // ** BEGIN PAYPAL EXPRESS CHECKOUT **
                } else {
                  ?><input type="hidden" name="payment" value="<?php echo $_SESSION['payment']; ?>" /><?php
                }
                // ** END PAYPAL EXPRESS CHECKOUT ** ?>
          <fieldset>
          <legend><?php echo TABLE_HEADING_COMMENTS; ?></legend>
          <?php echo zen_draw_textarea_field('comments', '45', '3'); ?>
          </fieldset>
          
          
          <?php
            if (DISPLAY_CONDITIONS_ON_CHECKOUT == 'true') {
          ?>
          <fieldset>
          <legend><?php echo TABLE_HEADING_CONDITIONS; ?></legend>
          <div><?php echo TEXT_CONDITIONS_DESCRIPTION;?></div>
          <?php echo  zen_draw_checkbox_field('conditions', '1', false, 'id="conditions"');?>
          <label class="checkboxLabel" for="conditions"><?php echo TEXT_CONDITIONS_CONFIRM; ?></label>
          </fieldset>
          <?php
            }
          ?>
          <?php if ((isset($_SESSION['shipping']['id']) && $_SESSION['cart']->get_content_type() == 'virtual') || (bool)preg_match('#storepickup#i', $_SESSION['shipping']['id'])) { ?>      
          <?php  } else { ?>
          <fieldset>
          <legend><?php echo TABLE_HEADING_CARRIER; ?></legend>
          <div><?php echo TEXT_CARRIER_DESCRIPTION;?></div>
          <?php echo  zen_draw_radio_field('carrier', 'ja', false, 'id="carrierja"');?>
          <label class="checkboxLabel" for="carrier"><?php echo TEXT_CARRIER_YES; ?></label>
          <?php echo  zen_draw_radio_field('carrier', 'nein', false, 'id="carriernein"');?>
          <label class="checkboxLabel" for="carrier"><?php echo TEXT_CARRIER_NO; ?></label>
          </fieldset>
          <?php
            }
          ?>
          <div class="buttonRow forward" id="paymentSubmit"><?php echo zen_image_submit(BUTTON_IMAGE_CONTINUE_CHECKOUT, BUTTON_CONTINUE_ALT, 'onclick="submitFunction('.zen_user_has_gv_account($_SESSION['customer_id']).','.$order->info['total'].')"'); ?></div>
          <div class="buttonRow back"><?php echo TITLE_CONTINUE_CHECKOUT_PROCEDURE . '<br />' . TEXT_CONTINUE_CHECKOUT_PROCEDURE; ?></div>
          
          
          </form>
          </div>


          Wenn du noch eine Datei brauchst, kein Problem. Danke Dir schon mal


          Liebe Grüße

          Kräuterhexe

          Kommentar


            #6
            Auf Deinem neuen Server läuft MySQL im Strict Mode, eine leere Übergabe ins ENUM Feld carrier durch das Modul Datenweitergabe an Versandunternehmen wird dann nicht akzeptiert.
            Das Feld wird nur dann leer übergeben, wenn die Zustimmungsabfrage nicht erscheint, z.B. bei Downloads oder anderen Artikeln, die keinen Versand haben.

            Lösung:
            Feld falls nicht ausgefüllt mit dem vorgesehenen Wert 'nein' übergeben

            includes/classes/order.php

            in Deinem Fall Zeile 530

            ändern von:

            Code:
            'carrier' => (isset($_SESSION['carrier']) ? $_SESSION['carrier'] : '')
            auf:
            Code:
            'carrier' => (isset($_SESSION['carrier']) ? $_SESSION['carrier'] : 'nein')
            Modul wird demnächst mit dieser Änderung aktualisiert

            Kommentar


              #7
              Hallo webchills,

              ich danke Dir für Deine Hilfe. Unser Provider hat auch eine Änderung am Webserver vorgenommen, so dass Paypal Zahlungen wieder funktionieren.

              Sie haben folgende Änderung vorgenommen. Sie haben die STRICT_TRANS_TABLES entfernt. Muss ich dann deine Änderung noch durchführen? Führt dies später zu Problemen? Soll die Tabelle wieder eingefügt werden?

              Außerdem wirft er 5 Logfiles beim Bezahlvorgang aus wo noch ein paar Probleme auftauchen:

              1.)

              Code:
              [14-Aug-2020 08:45:17 Europe/Berlin] Request URI: /ipn_main_handler.php?type=ec, IP address: xxx.xxx.xxx.xx#1  ot_netto->__construct() called at [/xxx/xxx/xxx/xxx/xxx/xxx/xxx/includes/classes/order_total.php:51]
              #2  order_total->__construct() called at [/xxx/xxx/xxx/xxx/xxx/xxx/xxx/includes/modules/payment/paypalwpp.php:1571]
              #3  paypalwpp->ec_step1() called at [/xxx/xxx/xxx/xxx/xxx/xxx/xxx/ipn_main_handler.php:76]
              --> PHP Warning: Use of undefined constant MODULE_PAYMENT_INVOICE_STATUS - assumed 'MODULE_PAYMENT_INVOICE_STATUS' (this will throw an Error in a future version of PHP) in /xxx/xxx/xxx/xxx/xxx/xxx/xxx/includes/modules/order_total/ot_netto.php on line 19.
              2.)

              Code:
              [14-Aug-2020 08:45:50 Europe/Berlin] Request URI: /ipn_main_handler.php?type=ec&token=EC-xxxU&PayerID=xxx, IP address: xxx.xxx.xxx.xxx#1  ot_netto->__construct() called at [/xxx/xxx/xxx/xxx/xxx/xxx/xxx/includes/classes/order_total.php:51]
              #2  order_total->__construct() called at [/xxx/xxx/xxx/xxx/xxx/xxx/xxx/includes/modules/payment/paypalwpp.php:1916]
              #3  paypalwpp->ec_step2() called at [/xxx/xxx/xxx/xxx/xxx/xxx/xxx/ipn_main_handler.php:81]
              --> PHP Warning: Use of undefined constant MODULE_PAYMENT_INVOICE_STATUS - assumed 'MODULE_PAYMENT_INVOICE_STATUS' (this will throw an Error in a future version of PHP) in /xxx/xxx/xxx/xxx/xxx/xxx/xxx/includes/modules/order_total/ot_netto.php on line 19.
              
              
              [14-Aug-2020 08:45:54 Europe/Berlin] Request URI: /ipn_main_handler.php?type=ec&token=EC-xxxU&PayerID=xxxx, IP address: xxx.xxx.xxx.xxx
              #1  ot_netto->__construct() called at [/xxx/xxx/xxx/xxx/xxx/xxx/xxx/includes/classes/order_total.php:51]
              #2  order_total->__construct() called at [/xxx/xxx/xxx/xxx/xxx/xxx/xxx/includes/modules/payment/paypalwpp.php:2849]
              #3  paypalwpp->terminateEC() called at [/xxx/xxx/xxx/xxx/xxx/xxx/xxx/includes/modules/payment/paypalwpp.php:2318]
              #4  paypalwpp->ec_step2_finish() called at [/xxx/xxx/xxx/xxx/xxx/xxx/xxx/includes/modules/payment/paypalwpp.php:1925]
              #5  paypalwpp->ec_step2() called at [/xxx/xxx/xxx/xxx/xxx/xxx/xxx/ipn_main_handler.php:81]
              --> PHP Warning: Use of undefined constant MODULE_PAYMENT_INVOICE_STATUS - assumed 'MODULE_PAYMENT_INVOICE_STATUS' (this will throw an Error in a future version of PHP) in /xxx/xxx/xxx/xxx/xxx/xxx/xxx/includes/modules/order_total/ot_netto.php on line 19.
              3.)

              Code:
              [14-Aug-2020 08:46:02 Europe/Berlin] Request URI: /checkout_payment, IP address: xxx.xxx.xxx.xxx#1  ot_netto->__construct() called at [/xxx/xxx/xxx/xxx/xxx/xxx/xxx/includes/classes/order_total.php:51]
              #2  order_total->__construct() called at [/xxx/xxx/xxx/xxx/xxx/xxx/xxx/includes/modules/pages/checkout_payment/header_php.php:99]
              #3  require(/xxx/xxx/xxx/xxx/xxx/xxx/xxx/includes/modules/pages/checkout_payment/header_php.php) called at [/xxx/xxx/xxx/xxx/xxx/xxx/xxx/index.php:36]
              --> PHP Warning: Use of undefined constant MODULE_PAYMENT_INVOICE_STATUS - assumed 'MODULE_PAYMENT_INVOICE_STATUS' (this will throw an Error in a future version
              4.)

              Code:
              [14-Aug-2020 08:46:07 Europe/Berlin] Request URI: /checkout_confirmation, IP address: xxx.xxx.xxx.xxx
              #1  ot_netto->__construct() called at [/xxx/xxx/xxx/xxx/xxx/xxx/xxx/includes/classes/order_total.php:51]
              #2  order_total->__construct() called at [/xxx/xxx/xxx/xxx/xxx/xxx/xxx/includes/modules/pages/checkout_confirmation/header_php.php:79]
              #3  require(/xxx/xxx/xxx/xxx/xxx/xxx/xxx/includes/modules/pages/checkout_confirmation/header_php.php) called at [/xxx/xxx/xxx/xxx/xxx/xxx/xxx/index.php:36]
              --> PHP Warning: Use of undefined constant MODULE_PAYMENT_INVOICE_STATUS - assumed 'MODULE_PAYMENT_INVOICE_STATUS' (this will throw an Error in a future version of PHP) in /xxx/xxx/xxx/xxx/xxx/xxx/xxx/includes/modules/order_total/ot_netto.php on line 19.
              5.)

              Code:
              [14-Aug-2020 08:46:11 Europe/Berlin] Request URI: /checkout_process, IP address: xxx.xxx.xxx.xxx
              #1  ot_netto->__construct() called at [/xxx/xxx/xxx/xxx/xxx/xxx/xxx/includes/classes/order_total.php:51]
              #2  order_total->__construct() called at [/xxx/xxx/xxx/xxx/xxx/xxx/xxx/includes/modules/checkout_process.php:61]
              #3  require(/xxx/xxx/xxx/xxx/xxx/xxx/xxx/includes/modules/checkout_process.php) called at [/xxx/xxx/xxx/xxx/xxx/xxx/xxx/includes/modules/pages/checkout_process/header_php.php:14]
              #4  require(/xxx/xxx/xxx/xxx/xxx/xxx/xxx/includes/modules/pages/checkout_process/header_php.php) called at [/xxx/xxx/xxx/xxx/xxx/xxx/xxx/index.php:36]
              --> PHP Warning: Use of undefined constant MODULE_PAYMENT_INVOICE_STATUS - assumed 'MODULE_PAYMENT_INVOICE_STATUS' (this will throw an Error in a future version of PHP) in /xxx/xxx/xxx/xxx/xxx/xxx/xxx/includes/modules/order_total/ot_netto.php on line 19.



              Diese Fehlermeldungen gibt er leider noch aus, der Bestellvorgang wird aber ausgeführt. Wenn ich die noch wegbekommen könnte wäre ich super glücklich.

              Liebe Grüße

              Kräuterhexe

              Kommentar


                #8
                Zitat von Kräuterhexe Beitrag anzeigen
                Unser Provider hat auch eine Änderung am Webserver vorgenommen, so dass Paypal Zahlungen wieder funktionieren.
                Sie haben folgende Änderung vorgenommen. Sie haben die STRICT_TRANS_TABLES entfernt. Muss ich dann deine Änderung noch durchführen? Führt dies später zu Problemen? Soll die Tabelle wieder eingefügt werden?
                Das bedeutet dass sie den MySQL Strict Mode deaktiviert haben. Die Änderung solltest Du trotzdem durchführen, die ist für jedes Szenario sinnvoll und verhindert, dass der Checkout im Strict Mode fehlschlägt. Wenn der Shop mal auf einen anderen Server mit Strict Mode verschoben wird, geht es sonst wieder von vorne los...

                Außerdem wirft er 5 Logfiles beim Bezahlvorgang aus wo noch ein paar Probleme auftauchen:
                Das sind Warnings, keine Errors, der Bezahlvorgang oder sonstige Funktionalitäten sind völlig in Ordnung.
                Hier scheint Zahlung auf Rechnung (Module > Zahlungsarten > invoice) nach einem Shopupdate nicht entfernt und neu initialisiert worden zu sein.
                Wenn Du Zahlung auf Rechnung nicht anbietest, nicht nur deaktivieren, sondern deinstallieren.
                Und falls Du es anbietest, Modul deinstallieren und wieder neu initialisieren
                Sollten danach noch immer Use of undefined constant MODULE_PAYMENT_INVOICE_STATUS Warnings in den Logs auftauchen, prüfe
                includes/languages/german/modules/payment/invoice.php
                Die ist dann sicher nicht auf dem Stand von 1.5.6

                Kommentar


                  #9
                  Hallo webchills,

                  danke für Deine schnelle Hilfe. Ich werde die Änderung für den Strict Mode vornehmen und werde nach dem Fehler suchen und ihn beheben, der diese Warnung verursacht, damit keine Logfiles mehr erscheinen.

                  Nachtrag:

                  Hier scheint Zahlung auf Rechnung (Module > Zahlungsarten > invoice) nach einem Shopupdate nicht entfernt und neu initialisiert worden zu sein.
                  Wenn Du Zahlung auf Rechnung nicht anbietest, nicht nur deaktivieren, sondern deinstallieren.
                  Und falls Du es anbietest, Modul deinstallieren und wieder neu initialisieren
                  Habe das überprüft, das Modul ist nie installiert gewesen, daran liegt es nicht das der Fehler kommt. Ich überprüfe noch die invoice Datei

                  includes/languages/german/modules/payment/invoice.php

                  Nochmals von Herzen einen ganz großen Dank

                  Liebe Grüße

                  Kräuterhexe
                  Zuletzt geändert von Kräuterhexe; 14.08.2020, 23:10.

                  Kommentar


                    #10
                    Hallo webchills,

                    habe die includes/languages/german/modules/payment/invoice.php Datei überprüft, das ist der Auszug.

                    Code:
                    <?php/**
                     * @package languageDefines
                     * @copyright Copyright 2003-2019 Zen Cart Development Team
                     * @copyright Portions Copyright 2003 osCommerce
                     * @license https://www.zen-cart-pro.at/license/3_0.txt GNU General Public License V3.0 
                     * @version $Id: invoice.php 296 2019-06-22 10:55:14Z webchills $
                     */
                     
                    if (IS_ADMIN_FLAG === true) {
                    if (!defined('MODULE_PAYMENT_INVOICE_STATUS')) define('MODULE_PAYMENT_INVOICE_STATUS', 'False');
                    if (!defined('MODULE_PAYMENT_INVOICE_BANKNAM')) define('MODULE_PAYMENT_INVOICE_BANKNAM', '');
                    if (!defined('MODULE_PAYMENT_INVOICE_ACCNAM')) define('MODULE_PAYMENT_INVOICE_ACCNAM', '');
                    if (!defined('MODULE_PAYMENT_INVOICE_ACCIBAN')) define('MODULE_PAYMENT_INVOICE_ACCIBAN', '');
                    if (!defined('MODULE_PAYMENT_INVOICE_BANKBIC')) define('MODULE_PAYMENT_INVOICE_BANKBIC', '');
                    }
                     
                    //Berechnung Zahlungsziel
                    if (MODULE_PAYMENT_INVOICE_STATUS === 'True'){
                    $tstamp = mktime(0, 0, 0, date('m'), date('d') + MODULE_PAYMENT_INVOICE_PAYDAY, date('Y'));
                    $tag = date('d.m.Y', $tstamp);
                    }
                    //Ende
                    define('MODULE_PAYMENT_INVOICE_TEXT_TITLE', 'Rechnung (zahlbar bis zum '. $tag . ')');
                    define('MODULE_PAYMENT_INVOICE_TEXT_DESCRIPTION', '');
                    
                    
                    define('MODULE_PAYMENT_INVOICE_TEXT_EMAIL_FOOTER', 
                    "Bitte verwenden Sie folgende Daten für die Überweisung des Gesamtbetrages:\n" .
                    "\nName der Bank:  " . MODULE_PAYMENT_INVOICE_BANKNAM .
                    "\nKontoinhaber: " . MODULE_PAYMENT_INVOICE_ACCNAM . 
                    "\nIBAN:    " . MODULE_PAYMENT_INVOICE_ACCIBAN .
                    "\nBIC/SWIFT:   " . MODULE_PAYMENT_INVOICE_BANKBIC . 
                    "\n");
                    Es ist die 1.5.6d Version.

                    Was mir auffällt, er verweist immer auf includes/modules/order_total/ot_netto.php

                    Code:
                    <?php
                    /**
                     * @package languageDefines
                     * @copyright Copyright 2003-2019 Zen Cart Development Team
                     * @copyright Portions Copyright 2003 osCommerce
                     * @license https://www.zen-cart-pro.at/license/3_0.txt GNU General Public License V3.0
                     
                     * @version $Id: ot_netto.php 627 2012-02-21 15:05:14Z webchills $
                     */
                    
                    
                    define('MODULE_ORDER_TOTAL_NETTO_TITLE', 'Netto-Betrag');
                    define('MODULE_ORDER_TOTAL_NETTO_DESCRIPTION', 'Netto-Rechnungsbetrag');
                    Fehlt hier die Definition ?

                    Liebe Grüße

                    Kräuterhexe
                    Zuletzt geändert von Kräuterhexe; 14.08.2020, 23:27. Grund: Nachtrag

                    Kommentar


                      #11
                      @ Use of undefined constant MODULE_PAMENT_INVOICE_STATUS in includes/modules/order_total/ot_netto.php:
                      Bitte postet hier alle Fehler rein, die Ihr in der STANDARDINSTALLATION von Zen-Cart findet.
                      Für Fehler in den Erweiterungen benutzt bitte die entsprechenden Unterforen.

                      Kommentar

                      Info zu diesem Forenarchiv:
                      Mit Release von 1.5.7 wurde die deutsche Zen Cart Version auf eine reine DIY-Lösung umgestellt.
                      Für einen Support via Forum stehen keine personellen und zeitlichen Ressourcen mehr zur Verfügung.
                      Dieses Supportforum bleibt im Nur-Lesen-Modus als Wissensarchiv noch online verfügbar.
                      PM Funktionalität, Registrierung und Posten neuer Beiträge sind deaktiviert.
                      Zugriff auf Anhänge in den Postings ist auch ohne Registrierung/Einloggen möglich.
                      FAQ und Downloadbereich des Forums wurden in die neue umfangreiche Knowledgebase auf der zen-cart-pro.at Website übernommen.

                      Das Development der deutschen Zen Cart Version geht wie bisher auf Github weiter.
                      Wir werden auch weiterhin neue Versionen bereitstellen und die Onlinedokumentation/Knowledgebase aktualisieren.
                      Fehler in der Software können auf Github als Issues gemeldet werden.
                      Follow us
                      aktuelle version
                      Zen Cart 1.5.7g deutsch
                      vom 12.12.2023
                      [Download]
                      Lädt...
                      X