PDA

Shop Support News Archive - Shopbetreiber News -> Forum : xt eCommerce Templates Module SEO Support: GPL Shop: Gutscheinversand An Eine Bestimmte Kundengruppe


Pommes
12.02.2006, 12:45
Shop-Version: 3.0.4

Zeilenangabe ist eine ca. Angabe und ohne Gewähr.
Zuvor die Dateien sichern.
Wie immer alles auf eigene Gafahr !!!


Datei: lang/SPRACHE/admin/gv_mail.php

hinter
define('TEXT_CUSTOMER', 'Kunde:');
Zeile 32 dies einfügen
define('TEXT_CUSTOMER_GROUP', 'Kundengruppe:');


hinter
define('TEXT_SELECT_CUSTOMER', 'Kunde auswählen');
Zeile 38 dies einfügen
define('TEXT_SELECT_ALTERNATIVE', '---- oder ----');
define('TEXT_SELECT_CUSTOMER_GROUP', 'Kundengruppe auswählen');


Zeile 42 suchen
define('ERROR_NO_CUSTOMER_SELECTED', 'Fehler: Es wurde kein Kunde ausgewählt.');
ersetzen mit
define('ERROR_NO_CUSTOMER_SELECTED', 'Fehler: Es wurde weder ein Kunde noch eine Kundengruppe ausgewählt.');


Datei: admin/gv_mail.php

hinter
require_once(DIR_FS_INC . 'xtc_php_mail.inc.php');
Zeile 38 dies einfügen
$customer_group_id = xtc_db_prepare_input($_POST['customer_group']);


Zeile 42 suchen
if ( ($_GET['action'] == 'send_email_to_user') && ($_POST['customers_email_address'] || $_POST['email_to']) && (!$_POST['back_x']) ) {
switch ($_POST['customers_email_address']) {
Zeile 42 ersetzen mit
if ( ($_GET['action'] == 'send_email_to_user') && ($_POST['customers_email_address'] || (strlen($customer_group_id)>0) || $_POST['email_to']) && (!$_POST['back_x']) ) {
if ($_POST['customers_email_address']) switch ($_POST['customers_email_address']) {


hinter
default:
$customers_email_address = xtc_db_prepare_input($_POST['customers_email_address']);

$mail_query = xtc_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_email_address = '" . xtc_db_input($customers_email_address) . "'");
****** $mail_sent_to = $_POST['customers_email_address'];
****** if ($_POST['email_to']) {
******** $mail_sent_to = $_POST['email_to'];
****** }
****** break;
}
Zeile 61 dies einfügen
elseif ((strlen($customer_group_id)>0)) {
$mail_query = xtc_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_status='" . $customer_group_id . "'");
****$group_query = xtc_db_query("select customers_status_name from " . TABLE_CUSTOMERS_STATUS . " where language_id='".$_SESSION['languages_id']."' and customers_status_id='" . xtc_db_input($customer_group_id) . "'");
$group_data = xtc_db_fetch_array($group_query);
$mail_sent_to = $group_data['customers_status_name'];
** }


Zeile 146 suchen
if ( ($_GET['action'] == 'preview') && (!$_POST['customers_email_address']) && (!$_POST['email_to']) ) {
ersetzen mit
if ( ($_GET['action'] == 'preview') && (!$_POST['customers_email_address']) && (!$_POST['customer_group']) && (!$_POST['email_to']) ) {


Zeile 196 suchen
if ( ($_GET['action'] == 'preview') && ($_POST['customers_email_address'] || $_POST['email_to']) ) {
** switch ($_POST['customers_email_address']) {
ersetzen mit
if ( ($_GET['action'] == 'preview') && ($_POST['customers_email_address'] || (strlen($customer_group_id)>0) || $_POST['email_to']) ) {
** if ($_POST['customers_email_address']) switch ($_POST['customers_email_address']) {


hinter
default:
****** $mail_sent_to = $_POST['customers_email_address'];
****** if ($_POST['email_to']) {
******** $mail_sent_to = $_POST['email_to'];
****** }
****** break;
** }
Zeile 210 dies einfügen
elseif ((strlen($customer_group_id)>0)) {
****$group_query = xtc_db_query("select customers_status_name from " . TABLE_CUSTOMERS_STATUS . " where language_id='".$_SESSION['languages_id']."' and customers_status_id='" . xtc_db_input($customer_group_id) . "'");
$group_data = xtc_db_fetch_array($group_query);
$mail_sent_to = $group_data['customers_status_name'];
** }


Zeile 218 suchen
<td class="smallText"><?php echo TEXT_CUSTOMER; ?>
<?php echo $mail_sent_to; ?></td>
Zeile ersetzen mit
<td class="smallText"><?php (strlen($customer_group_id)>0) ? print(TEXT_CUSTOMER_GROUP) : print(TEXT_CUSTOMER); ?>
<?php echo $mail_sent_to; ?></td>


hinter
$mail_query = xtc_db_query("select customers_id, customers_email_address, customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " ".$select." order by customers_lastname");
** while($customers_values = xtc_db_fetch_array($mail_query)) {
**** $customers[] = array('id' => $customers_values['customers_email_address'],
**************************'text' => $customers_values['customers_lastname'] . ', ' . $customers_values['customers_firstname'] . ' (' . $customers_values['customers_email_address'] . ')');
}
Zeile 289 vor ?> dies einfügen
$customer_group_ids = array();
** $customer_group_ids[] = array('id' => '', 'text' => TEXT_SELECT_CUSTOMER_GROUP);
** $group_query = xtc_db_query("select customers_status_id, customers_status_name from " . TABLE_CUSTOMERS_STATUS . " where language_id='".$_SESSION['languages_id']."' order by customers_status_name");
** while($group_values = xtc_db_fetch_array($group_query)) {
**** $customer_group_ids[] = array('id' => $group_values['customers_status_id'],
****************************'text' => $group_values['customers_status_name']);
** }


hinter
<tr>
************** <td class="main"><?php echo TEXT_CUSTOMER; ?></td>
************** <td><?php echo xtc_draw_pull_down_menu('customers_email_address', $customers, $_GET['customer']);?></td>
************ </tr>
Zeile 294 dies einfügen
<tr>
**************<td class="main">Â*</td>
**************<td><?php echo TEXT_SELECT_ALTERNATIVE ?></td>
************ </tr>
************ <tr>
************** <td class="main"><?php echo TEXT_CUSTOMER_GROUP; ?></td>
************** <td><?php echo xtc_draw_pull_down_menu('customer_group', $customergroups, $_GET['customer_group']);?></td>
************ </tr>


Nun kann man aus der Administration heraus auch an ganze Kundengruppen Gutscheine versenden

Hier die Dateien

/admin/
[attachmentid=2]

/lang/german/admin
[attachmentid=3]

Gruß
Pommes