<?php

/* -----------------------------------------------------------------
 * 	$Id: geizkragen.php 717 2013-11-05 15:38:31Z akausch $
 * 	Copyright (c) 2011-2021 commerce:SEO by Webdesign Erfurt
 * 	http://www.commerce-seo.de
 * ------------------------------------------------------------------
 * 	based on:
 * 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
 * 	(c) 2002-2003 osCommerce - www.oscommerce.com
 * 	(c) 2003     nextcommerce - www.nextcommerce.org
 * 	(c) 2005     xt:Commerce - www.xt-commerce.com
 * 	(c) 2013     Gambio GmbH - www.gambio.de
 * 	Released under the GNU General Public License
 * --------------------------------------------------------------- */

class Geizkragen {

    var $v_export_type;
    var $v_module_name;
    var $v_module_homepage;
    var $v_module_format;
    var $v_module_export_filename;
    var $v_filename;
    var $v_keyname;
    var $v_linkname;
    var $v_delimiter;
    var $v_enclosure;
    var $v_field_filename;
    var $v_field_customers_groups;
    var $v_field_currency;
    var $v_field_shipping_costs;
    var $v_field_shipping_costs_free;
    var $v_field_attributes;
    var $v_field_campaign;
    var $v_field_export;
    var $v_category_file_path;
    var $v_shipping_availability_array = array();
    var $v_availability_array = array();

    function Geizkragen() {
        $this->formSettings();
    }

    function formSettings() {
        $this->v_export_type = 'comparison';
        $this->v_module_name = 'Geizkragen.de';
        $this->v_module_homepage = 'www.geizkragen.de';
        $this->v_module_format = 'csv';
        $this->v_module_export_filename = 'geizkragen.csv';
        $this->v_filename = 'geizkragen.php';
        $this->v_keyname = 'GEIZKRAGEN';
        $this->v_linkname = 'geizkragen';
        $this->v_delimiter = ";";
        $this->v_enclosure = '';
        $this->v_field_filename = true;
        $this->v_field_customers_groups = true;
        $this->v_field_currency = true;
        $this->v_field_shipping_costs = true;
        $this->v_field_shipping_costs_free = true;
        $this->v_field_attributes = true;
        $this->v_field_campaign = true;
        $this->v_field_export = true;
    }

    function formAddOn() {
        $t_addOns = '<tr>
				   <td class="dataTableContent"><strong>Versandkosten Nachnahme</strong></td>
				   <td class="dataTableContent">' . xtc_draw_input_field('products_shipping_costs_nn', '0.00', 'style="width: 40px;"')
                . '<br />Geben Sie hier pauschale Versandkosten an, die bei Zahlung per Nachnahme anfallen.';


        // return addon setup
        return($t_addOns);
    }

    function formatResults($p_products_array) {
        $p_products_array['products_shipping_costs_nn'] = $_POST['products_shipping_costs_nn'];
        $p_products_array['products_price'] = number_format((double) $p_products_array['products_price'], 2, '.', '');

        return($p_products_array);
    }

    function exportScheme() {
        $t_csv_fields_array = array();
        $t_csv_fields_array['products_id'] = 'Artikelnummer';
        $t_csv_fields_array['products_categories_last'] = 'Kategorie';
        $t_csv_fields_array['manufacturers_name'] = 'Hersteller';
        $t_csv_fields_array['products_name'] = 'Produktname';
        $t_csv_fields_array['products_link'] = 'Deeplink';
        $t_csv_fields_array['products_image_1'] = 'Bildlink';
        $t_csv_fields_array['products_ean'] = 'EAN';
        $t_csv_fields_array['products_model'] = 'Herst-Art.Nr.';
        $t_csv_fields_array['products_price'] = 'Preis';
        $t_csv_fields_array['products_shipping_costs'] = 'Versandkosten VK';
        $t_csv_fields_array['products_shipping_costs_nn'] = 'Versandkosten NN';
        $t_csv_fields_array['products_shippingtime'] = 'Lieferzeit';

        return($t_csv_fields_array);
    }

}

?>