Technische Daten
ver 2.1

08.08.2005

Dieses Modul ist geeignet für xt:Commerce v3.0.3, sollte aber auch mit 2.0 RC1 und 1.0 beta 2 funktionieren.

Das Modul erlaubt tabellarisch technische (aber nicht nur) Daten aufzulisten Die Eingabe erfolgt komfortabel über den Administrationsbereich

Leider bisher ohne mehrsprachige Unterstützung

                  *Neu! - im Vergleich zu Version 1.02

                  *Neu! - im Vergleich zu Version 2.0




Benutzung:

Im Bereich der Kategorien / Produkte wurde ein Link zum Editieren der Daten hinzugefügt.

 

Möglichkeit zum Aufteilen in Gruppen, z.B. für ein Autoradio in die vorhandenen Komponenten: Das Radio, das Kassettendeck, der Verstärker.

 

Wiederholt eingegebene Namen für Daten werden gespeichert und der jeweiligen Gruppe zugeordnet. Damit stehen sie bei späteren Eingaben per Dropdown-Menü zur Verfügung und erleichtern die Eingabe gleicher Daten.



Installation


Erstellung der SQL Tabellen
Alles nötige befindet sich in der tpt.sql (Installation z.B. per phpmyadmin)

Änderungen im Admin-Bereich

1. Kopiere die neuen Dateien aus catalog/admin/ in die entsprechenden Ordner auf deinem Server.

2. Wir bearbeiten admin/categories_view.php. (um Zeile 120):

<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td>
<td class="dataTableHeadingContent" align="center"><?php echo "TPT"; ?></td> <!--TPT 2.1-->
<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_PRICE; ?></td>
<td class="dataTableHeadingContent" align="center"><?php echo '% max'; ?></td>
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?></td>
An den gezeigten Stellen den gelb markierten Code einfügen.

um Zeile 175:

<td class="dataTableContent" align="center">--</td>
<td class="dataTableContent" align="center">--</td>
<td class="dataTableContent" align="center">&nbsp;</td> <!-- // TPT 2.1-->
<td class="dataTableContent" align="right"><?php if ( (is_object($cInfo)) && ($categories['categories_id'] == $cInfo->categories_id) ) { echo xtc_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . xtc_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories['categories_id']) . '">' . xtc_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>


</tr>
um Zeile 243
<td class="dataTableContent" align="center"><a href=<?php echo xtc_href_link(FILENAME_PRODUCTS_PARAMETER . '?category_path=' . $cPath . '&products_id=' . $products['products_id']); ?>>TPT</a></td> <!-- // TPT 2.1-->
<td class="dataTableContent" align="center">
<?php
// Show price
echo $currencies->format($products['products_price']);
//End Show price

3. Wir bearbeiten admin/includes/application_top.php .

um Zeile 130

define('FILENAME_SHIPPING_STATUS', 'shipping_status.php');
define('FILENAME_SALES_REPORT','stats_sales_report.php');
define('FILENAME_MODULE_EXPORT','module_export.php');
// TPT 2.1
define('FILENAME_PRODUCTS_PARAMETER', 'parameters.php');
define('FILENAME_PRODUCTS_PARAMETER_COPIER', 'products_parameter_copier.php');
// TPT 2.1 End

um Zeile 184

define('TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS', 'products_options_values_to_products_options');
define('TABLE_PRODUCTS_TO_CATEGORIES', 'products_to_categories');
//TPT 2.1
define('TABLE_PRODUCT_PARAMETERS', 'products_parameters');
define('TABLE_PRODUCT_PARAMETERS_GROUPS', 'products_parameters_groups');
define('TABLE_PRODUCT_PARAMETERS_NAMES', 'products_parameters_names');
//TPT 2.1 END

4. Wir bearbeiten admin/includes/column_left.php (um Zeile 27)

echo ('<div class="menuBoxHeading"><b>'.BOX_HEADING_PRODUCTS.'</b></div>');
if (($_SESSION['customers_status']['customers_status_id'] == '0') && ($admin_access['categories']== '1')) echo '<a href="' . xtc_href_link(FILENAME_CATEGORIES, '', 'NONSSL') .'" class="menuBoxContentLink"> -' . BOX_CATEGORIES . '</a><br>';
//TPT Copier 2.1
if (($_SESSION['customers_status']['customers_status_id'] == '0') && ($admin_access['categories']== '1')) echo '<a href="' . xtc_href_link(FILENAME_PRODUCTS_PARAMETER_COPIER,'', 'NONSSL') . '" class="menuBoxContentLink"> -' . BOX_PARAMETER_COPIER .'</a><br>';
//TPT Copier 2.1 END

5. Wir bearbeiten lang/german/admin/german.php :
um Zeile 150

define('BOX_TOOLS_BLACKLIST','CC-Blacklist');
//TPT Copier 1.0 for TPT 2.1
define('BOX_PARAMETER_COPIER', 'Technische Daten kopieren');
//TPT Copier 1.0 END

6. Wir bearbeiten admin/includes/functions/html_output.php :
Am Ende einfügen, vor ?>


if (!function_exists("xtc_output_string")){
include_once(DIR_FS_INC. 'xtc_parse_input_field_data.inc.php');
function xtc_output_string($string, $translate = false, $protected = false) {
   if ($protected == true) {
      return htmlspecialchars($string);
   } else {
      if ($translate == false) {
        return xtc_parse_input_field_data($string, array('"' => '&quot;'));
      } else {
        return xtc_parse_input_field_data($string, $translate);
      }
  }
}

}
////
// Ausgabe in ein Mehrfachauswahlfenster
if (!function_exists("xtc_draw_pull_multiselect_menu")){

function xtc_draw_pull_multiselect_menu($name, $values, $defaults, $parameters ='') {
    $field = '<select multiple name="' . xtc_output_string($name) . '"';

      if (xtc_not_null($parameters)) $field .= ' ' . $parameters;

    $field .= '>' . "\n";

    if (empty($default) && isset($GLOBALS[$name])) $default= stripslashes($GLOBALS[$name]);

    for ($i = 0, $n = sizeof($values); $i < $n; $i++) {
        $field .= '<option value="' . xtc_output_string($values[$i]['id']) . '"';
        if (in_array($values[$i]['id'], $defaults)) {
            $field .= ' SELECTED';
        }
        $field .= '>' . xtc_output_string($values[$i]['text'], array('"' => '&quot;','\'' => '&#039;', '<' => '&lt;', '>' => '&gt;')) . '</option>';
    }
    $field .= '</select>';

    return $field;
 }
}

7. Wir bearbeiten admin/includes/functions/general.php :

Ändere in der Funktion xtc_remove_product()(um Zeile 1145):

    if (USE_CACHE == 'true') {
xtc_reset_cache_block('categories'); xtc_reset_cache_block('also_purchased'); } //TPT 2.1 $get_parameter_names_id = xtc_db_query("SELECT DISTINCT parameter_name_id FROM ". TABLE_PRODUCT_PARAMETERS . " WHERE products_id = '" . xtc_db_input($product_id). "'"); xtc_db_query("delete from " . TABLE_PRODUCT_PARAMETERS . " where products_id ='" . xtc_db_input($product_id) . "'"); while($parameter_names_id = xtc_db_fetch_array($get_parameter_names_id)){ $dup_par_n_query = xtc_db_query("select count(*) as total from " .TABLE_PRODUCT_PARAMETERS . " where parameter_name_id = '" .xtc_db_input($parameter_names_id['parameter_name_id']) . "'"); $dup_par_n = xtc_db_fetch_array($dup_par_n_query); if(!$dup_par_n['total']){ xtc_db_query("delete from " . TABLE_PRODUCT_PARAMETERS_NAMES . " where id = '" .xtc_db_input($parameter_names_id['parameter_name_id']) . "'"); } } //TPT 2.1 END

Änderungen am Katalog

8. Kopiere die neuen Dateien von catalog/ in den entsprechenden Ordner auf deinem Server

Achtung! wir gehen davon aus, das der Template Ordner templates/xtc2 ist.


9. Wir bearbeiten includes/modules/product_info.php

um Zeile 183

 include(DIR_WS_MODULES . FILENAME_PRODUCTS_MEDIA);
//TPT 2.1
include(DIR_WS_MODULES . 'tpt.php');
//TPT 2.1 end

10. Wir bearbeiten templates/xtc2/module/product_info/product_info_v1.html

um Zeile 130

  <table width="100%" border="0">
     <tr>
          <td><div align="center">{$MODULE_tpt}</div></td>
     </tr>
 </table>
{if $MODULE_also_purchased != ''}
 <table width="100%" border="0">
   <tr>
<td align="center">{$MODULE_also_purchased}<br/></td> </tr>
</table>{/if}
{$FORM_END}

11. Wir bearbeiten includes/database_tables.php

Am Ende anfügen, vor ?>

//TPT 2.1
define('TABLE_PRODUCT_PARAMETERS', 'products_parameters');
define('TABLE_PRODUCT_PARAMETERS_GROUPS', 'products_parameters_groups');
define('TABLE_PRODUCT_PARAMETERS_NAMES', 'products_parameters_names');
//TPT 2.1 end

12. Die Tabellen in der tpt.sql in die Datenbank einfügen.

Änderungen für Druckausgabe

13. Wir bearbeiten lang/german/lang_german.conf

Im Bereich [print_product_info] folgendes einfügen:

properties = 'Produkteigenschaften:'

14. Wir bearbeiten templates/xtc2/module/print_product_info.html

um Zeile 62

<table width="100%">
  <tr>
  <td align="left"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">{$PRODUCTS_DESCRIPTION}<br />
    <br />
    <strong>{if $module_content !=''}{#options#}<br />
    </strong> {foreach name=aussen item=module_data from=$module_content}
    {$module_data.GROUP}: {$module_data.NAME}<br />
    {/foreach} <br />
    <br />{/if}
    <strong>{if $module_parameters !=''}{#properties#}<br />
    </strong> {foreach name=params item=module_data2 from=$module_parameters}
    {$module_data2.GROUP}: {$module_data2.PARAMETER} = {$module_data2.VALUE}<br />
    {/foreach} <br />
    <br />{/if}
    <strong>{#price#} <font color="#FF0000">{$PRODUCTS_PRICE}</font></strong>
    </font></td>
  </tr>
</table>

15. Wir bearbeiten print_product_info.php

um Zeile 54

          $module_content[sizeof($module_content)-1]['NAME'] .= ' (' . $products_options['price_prefix'] . $xtPrice->xtcFormat($products_options['options_values_price'], true) .')';
        }
      }
    }
  }
 $products_parameters_query = xtc_db_query("select count(*) as total from " . TABLE_PRODUCT_PARAMETERS . " ppar where ppar.products_id='" . (int)$_GET['products_id'] . "'");
 $products_parameters = xtc_db_fetch_array($products_parameters_query);
 if ($products_parameters['total'] > 0) {
   $products_value_query = xtc_db_query("select distinct pnam.parameter_name, pgrp.group_name, ppar.value from " . TABLE_PRODUCT_PARAMETERS . " ppar, " . TABLE_PRODUCT_PARAMETERS_GROUPS . " pgrp, " . TABLE_PRODUCT_PARAMETERS_NAMES . " pnam where ppar.products_id='" . (int)$_GET['products_id'] . "' and pnam.id=ppar.parameter_name_id and pgrp.id=pnam.group_id order by pgrp.ord");
     while ($products_values = xtc_db_fetch_array($products_value_query)) {
       $module_parameters[] = array(
         'GROUP'=>$products_values['group_name'],
         'PARAMETER'=>$products_values['parameter_name'],
         'VALUE'=>$products_values['value']);
     }
 }
  // assign language to template for caching
  $smarty->assign('language', $_SESSION['language']);

  $image='';
  if ($product_info['products_image']!='') {
  $image=DIR_WS_CATALOG . DIR_WS_THUMBNAIL_IMAGES . $product_info['products_image'];
  }
  $smarty->assign('PRODUCTS_NAME', $product_info['products_name']);
  $smarty->assign('PRODUCTS_MODEL', $product_info['products_model']);
  $smarty->assign('PRODUCTS_DESCRIPTION', $product_info['products_description']);
  $smarty->assign('PRODUCTS_IMAGE',$image);
  $smarty->assign('PRODUCTS_PRICE', $products_price);
  $smarty->assign('module_content', $module_content);
  $smarty->assign('module_parameters', $module_parameters);

Aktuell sollte dies alles laufen.

Credits

ver 1.0-beta-russian_only - Spanium http://high-end.aac.ru/
ver 1.01 - Vetal
ver 1.02 - Vetal
ver 2.0 - Witalij Olejnik (xaoc ,xaoc2)  - xaoc@o2.pl
ver 2.1 - André Estel (Anotherone) - info@estelco.de