Jump to content
xt:Commerce Community Forum

Neue hilfreiche Funktion


wunschtacho

Recommended Posts

Hallo,

haben ?fters Kunden, die uns anschreiben und uns mitteilen, dass Sie einen Fehler bei der Bestellung gemacht haben, oft nur eine Kleinigkeit.

Die Bestellung kann man ja ohne Probleme von Hand ausbessern.

Sch?n w?re eine Funktion bei der man die Bestellung erneut versenden kann (z.B. mit Auswahl: an Admin und/oder Kunde)

Gibt es so etwas?

Gr??e

Link to comment
Share on other sites

Hi,

ich w?rde f?r das Vorhaben, an der send_order.php ansetzen ;)

man kann daraus eine Funktion mit einem Parameter machen, wo man die orders_id ?bergibt und dann die Benachrichtigung verschickt.

dann musst du es nur noch an die geeignete stelle als button einf?gen.. ;)

Gru?

TechWay

Link to comment
Share on other sites

Originally posted by techway@Apr 28 2006, 06:04 PM

sag mir deine email, ich schicke dir die erweiterung per email

Gru?

Steffen

Quoted post

Warum postest Du die L?sung nicht? Dann h?tten wir anderen evtl. auch etwas davon... :rolleyes:

Link to comment
Share on other sites

siehste, war doch zu lang... :ph34r:

na gut dann hier nur die ?nderungen:

in der Datei lang/german/admin/orders.php folgendes hinzuf?gen:


define('SUCCESS_ORDER_SEND', 'Erfolg: Die Bestellung wurde erfolgreich nochmals per Email verschickt!');

in der Datei admin/orders.php nach dieser Zeile:
switch ($_GET['action']) {
folgendes einf?gen:

case 'send' :

 $send_to_customer = true;

 $send_to_admin = false;


 $oID = xtc_db_prepare_input($_GET['oID']);


 $order = new order($oID);

 require (DIR_FS_CATALOG.DIR_WS_CLASSES.'xtcPrice.php');

 $xtPrice = new xtcPrice($order->info['currency'], $order->info['status']);

	// set dirs manual

 $smarty->template_dir = DIR_FS_CATALOG.'templates';

 $smarty->compile_dir = DIR_FS_CATALOG.'templates_c';

 $smarty->config_dir = DIR_FS_CATALOG.'lang';


 $smarty->assign('address_label_customer', xtc_address_format($order->customer['format_id'], $order->customer, 1, '', '<br />'));

 $smarty->assign('address_label_shipping', xtc_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br />'));

 if ($_SESSION['credit_covers'] != '1') {

 	$smarty->assign('address_label_payment', xtc_address_format($order->billing['format_id'], $order->billing, 1, '', '<br />'));

 }

 $smarty->assign('csID', $order->customer['csID']);


 // get products data

 $order_query = xtc_db_query("SELECT

    products_id,

    orders_products_id,

    products_model,

    products_name,

    final_price,

    products_quantity

    FROM ".TABLE_ORDERS_PRODUCTS."

    WHERE orders_id='".$oID."'");


 $order_data = array ();

 while ($order_data_values = xtc_db_fetch_array($order_query)) {

 	$attributes_query = xtc_db_query("SELECT

    	products_options,

    	products_options_values,

    	price_prefix,

    	options_values_price

    	FROM ".TABLE_ORDERS_PRODUCTS_ATTRIBUTES."

    	WHERE orders_products_id='".$order_data_values['orders_products_id']."'");

 	$attributes_data = '';

 	$attributes_model = '';

 	while ($attributes_data_values = xtc_db_fetch_array($attributes_query)) {	

  $attributes_data .= $attributes_data_values['products_options'].':'.$attributes_data_values['products_options_values'].'<br />';

  $attributes_model .= xtc_get_attributes_model($order_data_values['products_id'], $attributes_data_values['products_options_values']).'<br />';

 	}

 	$order_data[] = array ('PRODUCTS_MODEL' => $order_data_values['products_model'], 'PRODUCTS_NAME' => $order_data_values['products_name'], 'PRODUCTS_ATTRIBUTES' => $attributes_data, 'PRODUCTS_ATTRIBUTES_MODEL' => $attributes_model, 'PRODUCTS_PRICE' => $xtPrice->xtcFormat($order_data_values['final_price'], true),'PRODUCTS_SINGLE_PRICE' => $xtPrice->xtcFormat($order_data_values['final_price']/$order_data_values['products_quantity'], true), 'PRODUCTS_QTY' => $order_data_values['products_quantity']); 

 }

 // get order_total data

 $oder_total_query = xtc_db_query("SELECT

   	title,

   	text,

   	sort_order

   	FROM ".TABLE_ORDERS_TOTAL."

   	WHERE orders_id='".$oID."'

   	ORDER BY sort_order ASC");


 $order_total = array ();

 while ($oder_total_values = xtc_db_fetch_array($oder_total_query)) {


 	$order_total[] = array ('TITLE' => $oder_total_values['title'], 'TEXT' => $oder_total_values['text']);

 }


 // assign language to template for caching

 $smarty->assign('language', $_SESSION['language']);

 $smarty->assign('tpl_path', 'templates/'.CURRENT_TEMPLATE.'/');

 $smarty->assign('logo_path', HTTP_SERVER.DIR_WS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/img/');

 $smarty->assign('oID', $oID);

 if ($order->info['payment_method'] != '' && $order->info['payment_method'] != 'no_payment') {

 	include (DIR_WS_LANGUAGES.$_SESSION['language'].'/modules/payment/'.$order->info['payment_method'].'.php');

 	$payment_method = constant(strtoupper('MODULE_PAYMENT_'.$order->info['payment_method'].'_TEXT_TITLE'));

 }

 $smarty->assign('PAYMENT_METHOD', $payment_method);

 $smarty->assign('DATE', xtc_date_long($order->info['date_purchased']));

 $smarty->assign('order_data', $order_data);

 $smarty->assign('order_total', $order_total);

 $smarty->assign('NAME', $order->customer['name']);

 $smarty->assign('COMMENTS', $order->info['comments']);

 $smarty->assign('EMAIL', $order->customer['email_address']);

 $smarty->assign('PHONE',$order->customer['telephone']);


 // PAYMENT MODUL TEXTS

 // EU Bank Transfer

 if ($order->info['payment_method'] == 'eustandardtransfer') {

 	$smarty->assign('PAYMENT_INFO_HTML', MODULE_PAYMENT_EUTRANSFER_TEXT_DESCRIPTION);

 	$smarty->assign('PAYMENT_INFO_TXT', str_replace("<br />", "\n", MODULE_PAYMENT_EUTRANSFER_TEXT_DESCRIPTION));

 }


 // MONEYORDER

 if ($order->info['payment_method'] == 'moneyorder') {

 	$smarty->assign('PAYMENT_INFO_HTML', MODULE_PAYMENT_MONEYORDER_TEXT_DESCRIPTION);

 	$smarty->assign('PAYMENT_INFO_TXT', str_replace("<br />", "\n", MODULE_PAYMENT_MONEYORDER_TEXT_DESCRIPTION));

 }


 // dont allow cache

 $smarty->caching = false;


 $html_mail = $smarty->fetch(CURRENT_TEMPLATE.'/mail/'.$_SESSION['language'].'/order_mail.html');

 $txt_mail = $smarty->fetch(CURRENT_TEMPLATE.'/mail/'.$_SESSION['language'].'/order_mail.txt');


 // create subject

 $order_subject = str_replace('{$nr}', $oID, EMAIL_BILLING_SUBJECT_ORDER);

 $order_subject = str_replace('{$date}', strftime(DATE_FORMAT_LONG), $order_subject);

 $order_subject = str_replace('{$lastname}', $order->customer['lastname'], $order_subject);

 $order_subject = str_replace('{$firstname}', $order->customer['firstname'], $order_subject);


 // send mail to admin

 if ($send_to_admin)

 	xtc_php_mail($order->customer['email_address'], $order->customer['firstname'], EMAIL_BILLING_ADDRESS, STORE_NAME, EMAIL_BILLING_FORWARDING_STRING, $order->customer['email_address'], $order->customer['firstname'], '', '', $order_subject, $html_mail, $txt_mail);


 // send mail to customer

 if ($send_to_customer)

 	xtc_php_mail(EMAIL_BILLING_ADDRESS, EMAIL_BILLING_NAME, $order->customer['email_address'], $order->customer['firstname'].' '.$order->customer['lastname'], '', EMAIL_BILLING_REPLY_ADDRESS, EMAIL_BILLING_REPLY_ADDRESS_NAME, '', '', $order_subject, $html_mail, $txt_mail);


 if (AFTERBUY_ACTIVATED == 'true') {

 	require_once (DIR_WS_CLASSES.'afterbuy.php');

 	$aBUY = new xtc_afterbuy_functions($oID);

 	if ($aBUY->order_send())

  $aBUY->process_order();

 }

 $messageStack->add_session(SUCCESS_ORDER_SEND, 'success');


 xtc_redirect(xtc_href_link(FILENAME_ORDERS, 'oID='.$_GET['oID']));

in dieser Datei k?nnt ihr in Zeile 73 und 74 festlegen wer die Email erhalten soll:

$send_to_customer = true;

$send_to_admin = false;

wenn ihr nun eine Bestellung anklickt, erscheint ein "Senden"-Button...

Viele Gr??e

Steffen

Link to comment
Share on other sites

hab den Button noch vergessen...

in der admin/orders.php diese Zeile:


$contents[] = array ('align' => 'center', 'text' => '<a class="button" href="'.xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('oID', 'action')).'oID='.$oInfo->orders_id.'&action=edit').'">'.BUTTON_EDIT.'</a> <a class="button" href="'.xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('oID', 'action')).'oID='.$oInfo->orders_id.'&action=delete').'">'.BUTTON_DELETE.'</a>');

gegen diese ersetzen:

$contents[] = array ('align' => 'center', 

     'text' => '<a class="button" href="'.xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('oID', 'action')).'oID='.$oInfo->orders_id.'&action=edit').'">'.BUTTON_EDIT.'</a> 

      	<a class="button" href="'.xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('oID', 'action')).'oID='.$oInfo->orders_id.'&action=delete').'">'.BUTTON_DELETE.'</a> 

      <a class="button" href="'.xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array ('oID', 'action')).'oID='.$oInfo->orders_id.'&action=send').'">'.BUTTON_SEND.'</a>');

Link to comment
Share on other sites

Originally posted by wunschtacho@Apr 21 2006, 05:16 PM

Die Bestellung kann man ja ohne Probleme von Hand ausbessern.

verr?tst du mir wie?

direkt in der DB oder gibts einen einfacheren weg.

ich suche schon die ganze zeit eine m?glichkeit dummy-bestellungen zu ?ndern.

z.b. ich bestelle selbst und trage sp?ter einen kunden ein der ausserhalb vom shop gekauft hat.

gibts denn sowas?

Link to comment
Share on other sites

Hallo "techway" und alle Forumsmitglieder, die Anleitung zum manuellen Versenden Bestellemail las ich und habe sie versucht bei mir (Version 3.03) ein zubauen.

Die Zeile f?r den Button habe ich wie folgt umgestellt:

$contents[] = array('align' => 'center', 'text' => '<a href="' . xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit') . '">' . xtc_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=delete') . '">' . xtc_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=send') . '">' . xtc_image_button('button_senden.gif', IMAGE_SENDEN) . '</a> ');
--> scheint auch zu klappen, aber nun gibt's Fehler wie:
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /www/htdocs/w006b9a3/shop/admin/orders.php:1) in /www/htdocs/w006b9a3/shop/admin/includes/application_top.php on line 332
danach MEGAFEHLER
?

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /www/htdocs/w006b9a3/shop/admin/orders.php:1) in /www/htdocs/w006b9a3/shop/admin/includes/application_top.php on line 332

?

Warning: main(): open_basedir restriction in effect. File(/shop/lang/german/modules/payment/cod.php) is not within the allowed path(s): (/www/htdocs/w006b9a3/:/tmp:/usr/bin:/www/htdocs/w006b9a3:/bin:/usr/local/bin:/usr/share/php) in /www/htdocs/w006b9a3/shop/admin/orders.php on line 138


Warning: main(/shop/lang/german/modules/payment/cod.php): failed to open stream: Operation not permitted in /www/htdocs/w006b9a3/shop/admin/orders.php on line 138


Warning: main(): open_basedir restriction in effect. File(/shop/lang/german/modules/payment/cod.php) is not within the allowed path(s): (/www/htdocs/w006b9a3/:/tmp:/usr/bin:/www/htdocs/w006b9a3:/bin:/usr/local/bin:/usr/share/php) in /www/htdocs/w006b9a3/shop/admin/orders.php on line 138


Warning: main(/shop/lang/german/modules/payment/cod.php): failed to open stream: Operation not permitted in /www/htdocs/w006b9a3/shop/admin/orders.php on line 138


Warning: main(): Failed opening '/shop/lang/german/modules/payment/cod.php' for inclusion (include_path='.:/usr/share/php:..') in /www/htdocs/w006b9a3/shop/admin/orders.php on line 138


Warning: constant(): Couldn't find constant MODULE_PAYMENT_COD_TEXT_TITLE in /www/htdocs/w006b9a3/shop/admin/orders.php on line 139


Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/w006b9a3/shop/admin/orders.php:1) in /www/htdocs/w006b9a3/shop/admin/includes/functions/general.php on line 146 

Es erscheint auch eine Meldung, dass die Mail erfolgreich versandt wurde. (Was auch stimmt!) Aber die pers?nliche Anrede (nach dieser Anleitung gebastelt: http://www.xt-commerce.com/forums/index.php?showtopic=5292 von khan_thep) fehlt dann, statt dessen neutral "Sehr geehrter Kunde".

K?nnt Ihr mir helfen? Was l?uft da wieder schief?

Link to comment
Share on other sites

Erstmal:

Wahnsinn!

Finde ich saugeil, dass du das umgesetzt hast - muss ich gleich mal testen!

Gr??e

Originally posted by tom4545@Apr 28 2006, 08:52 PM

verr?tst du mir wie?

direkt in der DB oder gibts einen einfacheren weg.

ich suche schon die ganze zeit eine m?glichkeit dummy-bestellungen zu ?ndern.

z.b. ich bestelle selbst und trage sp?ter einen kunden ein der ausserhalb vom shop gekauft hat.

gibts denn sowas?

Quoted post

Kann man erst ab Version 3...

Link to comment
Share on other sites

??

Bekomme den Button gar nicht erst angezeigt - was mache ich denn falsch?

Das habe ich ?bernommen:

in der admin/orders.php diese Zeile:

CODE

$contents[] = array ('align' => 'center', 'text' => ''.BUTTON_EDIT.' '.BUTTON_DELETE.'');

gegen diese ersetzen:

CODE

$contents[] = array ('align' => 'center',

'text' => ''.BUTTON_EDIT.'

'.BUTTON_DELETE.'

'.BUTTON_SEND.'');

Link to comment
Share on other sites

ok, zu dumm den senden button zu sehen ;)

Versand funktioniert jetzt einwandfrei, nur die Fehlermeldung st?rt etwas:


Warning: main(/lang/german/modules/payment/moneyorder.php): failed to open stream: No such file or directory in /homepages/38/d70348839/htdocs/shop304/admin/orders.php on line 142


Warning: main(): Failed opening '/lang/german/modules/payment/moneyorder.php' for inclusion (include_path='.:/usr/local/lib/php') in /homepages/38/d70348839/htdocs/shop304/admin/orders.php on line 142


Warning: constant(): Couldn't find constant MODULE_PAYMENT_MONEYORDER_TEXT_TITLE in /homepages/38/d70348839/htdocs/shop304/admin/orders.php on line 143


Warning: Cannot modify header information - headers already sent by (output started at /homepages/38/d70348839/htdocs/shop304/admin/orders.php:142) in /homepages/38/d70348839/htdocs/shop304/admin/includes/functions/general.php on line 130

Meiner Meinung nach, weil man sich im Verzeichnis /admin/ befindet - von dort aus will er dann auf /lang/german/modules/payment/moneyorder.php zugreifen, wass ja nicht geht - m?sste dann

../lang/german/modules/payment/moneyorder.php lauten

einer eine Idee?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
  • Create New...