Moin,
ich habe in meinem XT Shop eine Erweiterung, die in der Artikelbearbeitung 3 verschiedene Möglichkeiten bietet, die Attribute zu bearbeiten:
- Änderungen speichern und alle Attribute editieren
- Änderungen speichern und alle mit Werten belegte Attribute editieren
- Änderungen speichern und alle Attribute von vorhandenem Produkt kopieren
Ich fand diese Erweiterung ganz sinnvoll und habe sie mal in den modified eCommerce Shopsoftware eingebaut und sie funktioniert auch da:
Ich gebe mal hier die Anleitung wieder (von wem diese Erweiterung stammt, weiß ich nicht, es gibt nur die Initialen MH)
1. /lang/german/admin/buttons.php
vor dem
?>
am Schluss einfügen:
//mh_attribut_erweiterungdefine('BUTTON_SAVE_EXISTING_ATTRIBUTES_EDIT', 'Änderungen speichern und bereits mit Werten belegte Attribute editieren');define('BUTTON_SAVE_ATTRIBUTES_EDIT', 'Änderungen speichern und alle Attribute editieren');define('BUTTON_SAVE_ATTRIBUTES_COPY', 'Änderungen speichern und alle Attribute von vorhandenem Produkt kopieren');define('BUTTON_INSERT_ATTRIBUTES_EDIT', 'Artikel anlegen und Attribute editieren');define('BUTTON_INSERT_ATTRIBUTES_COPY', 'Artikel anlegen und Attribute kopieren'); 2. in der /admin/includes/modules/new_product.php:
nach
<?php echo '<a class="button" href="' . xtc_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $_GET['pID']) . '">' . BUTTON_CANCEL . '</a>'; ?>
einfügen:
<?php $NeuesZiel = FILENAME_CATEGORIES .'?cPath=' . $_GET['cPath'] . '&pID=' . $_GET['pID'];
if ($form_action == 'update_product') {
$NeueAktion = $NeuesZiel . '&action=update_product_edit_attributes'; ?><button name="update_product_edit_attributes" type="button" value="<?php echo BUTTON_SAVE_ATTRIBUTES_EDIT; ?>" onclick="this.form.action='<?php echo $NeueAktion; ?>';this.form.submit()"><?php echo BUTTON_SAVE_ATTRIBUTES_EDIT; ?></button>
<?php $NeueAktion = $NeuesZiel . '&action=update_product_edit_existing_attributes'; ?><button name="update_product_edit_existing_attributes" type="button" value="<?php echo BUTTON_SAVE_EXISTING_ATTRIBUTES_EDIT; ?>" onclick="this.form.action='<?php echo $NeueAktion; ?>';this.form.submit()"><?php echo BUTTON_SAVE_EXISTING_ATTRIBUTES_EDIT; ?></button>
<?php $NeueAktion = $NeuesZiel . '&action=update_product_copy_attributes';?><button name="update_product_copy_attributes" type="button" value="<?php echo BUTTON_SAVE_ATTRIBUTES_COPY; ?>" onclick="this.form.action='<?php echo $NeueAktion; ?>';this.form.submit()"><?php echo BUTTON_SAVE_ATTRIBUTES_COPY; ?></button>
<?php
}
elseif ($form_action == 'insert_product') {
$NeueAktion = $NeuesZiel . '&action=insert_product_edit_attributes';
?><input type="button" value="<?php echo BUTTON_INSERT_ATTRIBUTES_EDIT; ?>" onClick="this.form.action='<?php echo $NeueAktion; ?>';this.form.submit()">
<?php $NeueAktion = $NeuesZiel . '&action=insert_product_copy_attributes';?><input type="button" value="<?php echo BUTTON_INSERT_ATTRIBUTES_COPY; ?>" onClick="this.form.action='<?php echo $NeueAktion; ?>';this.form.submit()">
<?php
};?>
3.in der /admin/categories.php
ca. Mitte der Datei:
vor:
<!doctype html public "-//W3C//DTD HTML 4.01 Tranistional//EN">
einfügen:
// mh Artikel-Attributsbearbeitungif (($_GET['action'] == 'update_product_copy_attributes') or
($_GET['action'] == 'insert_product_copy_attributes')) { xtc_redirect
(xtc_href_link
('new_attributes.php', xtc_get_all_get_params
(array ('action')).'action=mh_copy'));}elseif (($_GET['action'] == 'update_product_edit_attributes') or
($_GET['action'] == 'insert_product_edit_attributes')) { xtc_redirect
(xtc_href_link
('new_attributes.php', xtc_get_all_get_params
(array ('action')).'action=mh_edit'));}elseif (($_GET['action'] == 'update_product_edit_existing_attributes')) { xtc_redirect
(xtc_href_link
('new_attributes.php', xtc_get_all_get_params
(array ('action')).'action=mh_edit_selected'));} else {?> und wichtig dann am Dateiende, vor dem ?> noch die schließende Klammer }
sieht dann so aus:
<?php require(DIR_WS_INCLUDES . 'application_bottom.php');
}
?>
4. in der Datei /admin/new_attributes.php
ersetze:
default:
$pageTitle = TITLE_EDIT;
include(DIR_WS_MODULES.'new_attributes_select.php');
break;
mit
default:
if (($_GET['action']=='mh_edit') or ($_GET['action']=='mh_edit_selected')) {
$pageTitle = TITLE_EDIT .': ' . xtc_findTitle($_GET['pID'], $languageFilter);
$_POST['current_product_id'] = $_GET['pID'];
include(DIR_WS_MODULES.'new_attributes_include.php');
break;
}
$pageTitle = TITLE_EDIT;
include(DIR_WS_MODULES.'new_attributes_select.php');
break;
5. in der Datei /admin/includes/modules/new_attributes_select.php
nach
$matches = xtc_db_num_rows($result)
einfügen:
$AktuellTitle = xtc_findTitle($_GET['pID'], $languageFilter);
und ersetze
echo "<OPTION VALUE=\"" . $current_product_id . "\">" . $title;
durch
if ($title == $AktuellTitle) {
echo "<OPTION SELECTED VALUE=\"" . $current_product_id . "\">" . $title;
}else{
echo "<OPTION VALUE=\"" . $current_product_id . "\">" . $title;
}
6. in der Datei /admin/includes/classes/categories.php
suche die Funktion // inserts / updates a product from given data, dort ziemlich am Schluß der Funktion nach
if ($action == 'insert') {$insert_sql_data = array ('products_id' => $products_id, 'language_id' => $language_id);$sql_data_array = xtc_array_merge
($sql_data_array, $insert_sql_data);xtc_db_perform
(TABLE_PRODUCTS_DESCRIPTION
, $sql_data_array); einfügen (ca.Zeile 740):
if ($products_id != '') $_GET['pID']=$products_id;
7.Suche in der /admin/includes/modules/new_attributes_include.php:
// Print the Current Value Name
und ersetze
echo "<TR class=\"" . $rowClass . "\">";
mit
if ($isSelected){
echo "<TR bgcolor=\"yellow\">";
}
else { echo "<TR class=\"" . $rowClass . "\">";
}
if (($_GET['action'] != 'mh_edit_selected') or ($_GET['action'] == 'mh_edit_selected')and($isSelected)) {
und in dieser Datei nach // Download function end wieder die schließende Klammer }
also so:
// Download function end
}
}
Das war's, bei mir funktioniert es und der Einbau dürfte schnell erledigt sein.
Die Bottoms sind mir noch zu groß, wer da noch einen Tipp hat, ist vermutlich leicht hinzukriegen, aber morgen ist ja auch noch ein Tag...
[ Für Gäste sind keine Dateianhänge sichtbar ]
[ Für Gäste sind keine Dateianhänge sichtbar ]
Linkback: https://www.modified-shop.org/forum/index.php?topic=6915.0