error_in_line Posted April 27, 2006 Report Share Posted April 27, 2006 habe erstmal eine xtc_get_products_price.inc.php angelegt (nach dieser idee: http://www.xt-commerce.com/forums/index.ph...F6nliche+anrede ) inhalt "xtc_get_products_price.inc.php": <?php /* ----------------------------------------------------------------------------------------- $Id: xtc_get_products_price.inc.php,v 1.6 2004/04/26 12:28:47 fanta2k Exp $ XT-Commerce - community made shopping http://www.xt-commerce.com Copyright (c) 2003 XT-Commerce ----------------------------------------------------------------------------------------- based on: (c) 2000-2001 The Exchange Project (earlier name of osCommerce) (c) 2002-2003 osCommerce(product_info.php,v 1.94 2003/05/04); [url]www.oscommerce.com[/url] (c) 2003 nextcommerce (print_product_info.php,v 1.16 2003/08/25); [url]www.nextcommerce.org[/url] Released under the GNU General Public License ---------------------------------------------------------------------------------------*/ function xtc_get_products_price($oID) {$products_price_query = xtc_db_query("select * from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . $_GET['oID'] . "' "); $result = xtc_db_fetch_array($products_price_query); return $result['productprice']; } ?> jetzt in der im oberen bereich der "send_order.php" require_once(DIR_FS_INC . 'xtc_get_products_price.inc.php'); und weiter unten $smarty->assign('PRODUCTPRICE',xtc_get_products_price($_SESSION['oID'])); zum dritten habe ich meine "print_order.html" im template erg?nzt: {$order_values.PRODUCTS_NAME}{$order_values.PRODUCTS_ATTRIBUTES} --N-E-U--> {$PRODUCTPRICE} problem: bereits bei der bestellung kommt folgende meldung Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/shop/inc/xtc_get_products_price.inc.php:33) in /www/htdocs/shop/inc/xtc_redirect.inc.php on line 28 in der zeile 28 der redirect steht: header('Location: ' . $url); die bestellung kann ich mir aber im adminbereich trotzdem ansehen; das rechnungsformular ist aber ohne einzelpreis ... nun meine bitte: wei? jemand rat und kann mir helfen? Link to comment Share on other sites More sharing options...
tom4545 Posted April 28, 2006 Report Share Posted April 28, 2006 keine ahnung was du da treibst. aber hier is meine erg?nzung in der print_order.html {$order_values.PRODUCTS_SINGLE_PRICE} das liegt in einer spalte vor dem gesamtpreis hier meine admin/print_order.php <?php /* ----------------------------------------------------------------------------------------- $Id: print_order.php,v 1.7 2004/02/20 15:35:38 fanta2k Exp $ XT-Commerce - community made shopping http://www.xt-commerce.com Copyright (c) 2003 XT-Commerce ----------------------------------------------------------------------------------------- based on: (c) 2003 nextcommerce (print_order.php,v 1.1 2003/08/19); [url]www.nextcommerce.org[/url] Released under the GNU General Public License ---------------------------------------------------------------------------------------*/ require('includes/application_top.php'); // include needed functions require_once(DIR_FS_INC .'xtc_get_products_price.inc.php'); require_once(DIR_FS_INC .'xtc_get_order_data.inc.php'); require_once(DIR_FS_INC .'xtc_get_attributes_model.inc.php'); require_once(DIR_FS_INC .'xtc_not_null.inc.php'); require_once(DIR_FS_INC .'xtc_format_price_order.inc.php'); $smarty = new Smarty; $order_query_check = xtc_db_query("SELECT customers_id FROM ".TABLE_ORDERS." WHERE orders_id='".(int)$_GET['oID']."'"); $order_check = xtc_db_fetch_array($order_query_check); // if ($_SESSION['customer_id'] == $order_check['customers_id']) // { // get order data include(DIR_WS_CLASSES . 'order.php'); $order = new order($_GET['oID']); $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>')); $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='".(int)$_GET['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 .='<br>'.$attributes_data_values['products_options'].':'.$attributes_data_values['products_options_values']; $attributes_model .='<br>'.xtc_get_attributes_model($order_data_values['products_id'],$attributes_data_values['products_options_values']); } $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_SINGLE_PRICE' => xtc_format_price_order($order_data_values['final_price']/$order_data_values['products_quantity'],1,$order->info['currency']), 'PRODUCTS_PRICE' => xtc_format_price_order($order_data_values['final_price'],1,$order->info['currency']), 'PRODUCTS_QTY' => $order_data_values['products_quantity']); } // get order_total data $oder_total_query=xtc_db_query("SELECT title, text, class, value, sort_order FROM ".TABLE_ORDERS_TOTAL." WHERE orders_id='".$_GET['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'], 'CLASS'=> $oder_total_values['class'], 'VALUE'=> $oder_total_values['value'], 'TEXT' => $oder_total_values['text']); if ($oder_total_values['class']='ot_total') $total=$oder_total_values['value']; } // assign language to template for caching $smarty->assign('language', $_SESSION['language']); $smarty->assign('logo_path',HTTP_SERVER . DIR_WS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/img/'); $smarty->assign('oID',$_GET['oID']); if ($order->info['payment_method']!='' && $order->info['payment_method']!='no_payment') { include(DIR_FS_CATALOG.'lang/'.$_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); // dont allow cache $smarty->caching = false; $smarty->template_dir=DIR_FS_CATALOG.'templates'; $smarty->compile_dir=DIR_FS_CATALOG.'templates_c'; $smarty->config_dir=DIR_FS_CATALOG.'lang'; $smarty->display(CURRENT_TEMPLATE . '/admin/print_order.html'); // } else { // $smarty->display(CURRENT_TEMPLATE . '/error_message.html'); // } ?> Link to comment Share on other sites More sharing options...
error_in_line Posted April 28, 2006 Author Report Share Posted April 28, 2006 Hab vielen Dank f?r die Antwort! Meine "print_order.php" (V3.03) sieht so aus: <?php /* ----------------------------------------------------------------------------------------- $Id: print_order.php,v 1.7 2004/02/20 15:35:38 fanta2k Exp $ XT-Commerce - community made shopping http://www.xt-commerce.com Copyright (c) 2003 XT-Commerce ----------------------------------------------------------------------------------------- based on: (c) 2003 nextcommerce (print_order.php,v 1.1 2003/08/19); [url]www.nextcommerce.org[/url] Released under the GNU General Public License ---------------------------------------------------------------------------------------*/ require('includes/application_top.php'); // include needed functions require_once(DIR_FS_INC .'xtc_get_order_data.inc.php'); require_once(DIR_FS_INC .'xtc_get_attributes_model.inc.php'); require_once(DIR_FS_INC .'xtc_not_null.inc.php'); require_once(DIR_FS_INC .'xtc_format_price_order.inc.php'); $smarty = new Smarty; $order_query_check = xtc_db_query("SELECT customers_id FROM ".TABLE_ORDERS." WHERE orders_id='".(int)$_GET['oID']."'"); $order_check = xtc_db_fetch_array($order_query_check); // if ($_SESSION['customer_id'] == $order_check['customers_id']) // { // get order data include(DIR_WS_CLASSES . 'order.php'); $order = new order($_GET['oID']); $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 />')); $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='".(int)$_GET['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 .='<br />'.$attributes_data_values['products_options'].':'.$attributes_data_values['products_options_values']; $attributes_model .='<br />'.xtc_get_attributes_model($order_data_values['products_id'],$attributes_data_values['products_options_values']); } $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' => xtc_format_price_order($order_data_values['final_price'],1,$order->info['currency']), 'PRODUCTS_QTY' => $order_data_values['products_quantity']); } // get order_total data $oder_total_query=xtc_db_query("SELECT title, text, class, value, sort_order FROM ".TABLE_ORDERS_TOTAL." WHERE orders_id='".$_GET['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'], 'CLASS'=> $oder_total_values['class'], 'VALUE'=> $oder_total_values['value'], 'TEXT' => $oder_total_values['text']); if ($oder_total_values['class']='ot_total') $total=$oder_total_values['value']; } // assign language to template for caching $smarty->assign('language', $_SESSION['language']); $smarty->assign('logo_path',HTTP_SERVER . DIR_WS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/img/'); $smarty->assign('oID',$_GET['oID']); if ($order->info['payment_method']!='' && $order->info['payment_method']!='no_payment') { include(DIR_FS_CATALOG.'lang/'.$_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); // dont allow cache $smarty->caching = false; $smarty->template_dir=DIR_FS_CATALOG.'templates'; $smarty->compile_dir=DIR_FS_CATALOG.'templates_c'; $smarty->config_dir=DIR_FS_CATALOG.'lang'; $smarty->display(CURRENT_TEMPLATE . '/admin/print_order.html'); // } else { // $smarty->display(CURRENT_TEMPLATE . '/error_message.html'); // } ?> Habe Sie testweise gegen Deine ersetzt. Die Datei "xtc_get_products_price.inc.php" gab es bei mir nicht, aber "xtc_oe_products_price.inc.php". Habe entsprechendes in Deiner "print_order.php" ge?ndert. Aber jetzt ben?tigt das xt:c (V3.03) eine "xtc_get_products_special_price.inc.php" und "xtc_format_special_price.inc.php". Diese beiden Dateien gibt es bei mir nicht, weder im verzeichnis /inc noch ?berhaupt. Was kann ich tun? Woher kommen die "xtc_get_products_special_price.inc.php" und "xtc_format_special_price.inc.php". Bitte antworte noch mal. Danke! Link to comment Share on other sites More sharing options...
tom4545 Posted April 28, 2006 Report Share Posted April 28, 2006 sorry keine ahnung - bin php laie die ?nderung war f?r v2 aber probier doch mal die eingef?gte _single_price auf 3 abzustimmen 'PRODUCTS_MODEL' => $order_data_values['products_model'], 'PRODUCTS_NAME' => $order_data_values['products_name'], 'PRODUCTS_ATTRIBUTES' => $attributes_data, 'PRODUCTS_ATTRIBUTES_MODEL' => $attributes_model, 'PRODUCTS_SINGLE_PRICE' => xtc_format_price_order($order_data_values['final_price']/$order_data_values['products_quantity'],1,$order->info['currency']), 'PRODUCTS_PRICE' => xtc_format_price_order($order_data_values['final_price'],1,$order->info['currency']), 'PRODUCTS_QTY' => $order_data_values['products_quantity']); } Link to comment Share on other sites More sharing options...
error_in_line Posted April 29, 2006 Author Report Share Posted April 29, 2006 Hallo "tom4545", vielen und herzlichen Dank f?r Deine Antworten!!! Der letzte Tip, das war die L?sung! Ich fasse Deine Anleitung f?r andere nochmal zusammen: Fragestellung: Wie werden mir in der Rechnung extra noch die Einzelpreise je Artikel ausgewiesen? Verwendete Version 3.03 von xt:c. 1) ?ndere die Datei /shop/admin/print_order.php und f?ge diese Zeile neu ein: 'PRODUCTS_SINGLE_PRICE' => xtc_format_price_order($order_data_values['final_price']/$order_data_values['products_quantity'],1,$order->info['currency']), Die print_order.php sieht dann so aus: <?php /* ----------------------------------------------------------------------------------------- $Id: print_order.php,v 1.7 2004/02/20 15:35:38 fanta2k Exp $ XT-Commerce - community made shopping http://www.xt-commerce.com Copyright (c) 2003 XT-Commerce ----------------------------------------------------------------------------------------- based on: (c) 2003 nextcommerce (print_order.php,v 1.1 2003/08/19); [url]www.nextcommerce.org[/url] Released under the GNU General Public License ---------------------------------------------------------------------------------------*/ require('includes/application_top.php'); // include needed functions require_once(DIR_FS_INC .'xtc_get_products_price.inc.php'); require_once(DIR_FS_INC .'xtc_get_order_data.inc.php'); require_once(DIR_FS_INC .'xtc_get_attributes_model.inc.php'); require_once(DIR_FS_INC .'xtc_not_null.inc.php'); require_once(DIR_FS_INC .'xtc_format_price_order.inc.php'); $smarty = new Smarty; $order_query_check = xtc_db_query("SELECT customers_id FROM ".TABLE_ORDERS." WHERE orders_id='".(int)$_GET['oID']."'"); $order_check = xtc_db_fetch_array($order_query_check); // if ($_SESSION['customer_id'] == $order_check['customers_id']) // { // get order data include(DIR_WS_CLASSES . 'order.php'); $order = new order($_GET['oID']); $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>')); $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='".(int)$_GET['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 .='<br>'.$attributes_data_values['products_options'].':'.$attributes_data_values['products_options_values']; $attributes_model .='<br>'.xtc_get_attributes_model($order_data_values['products_id'],$attributes_data_values['products_options_values']); } $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, // DIESE ZEILE NEU EINF?GEN 'PRODUCTS_SINGLE_PRICE' => xtc_format_price_order($order_data_values['final_price']/$order_data_values['products_quantity'],1,$order->info['currency']), 'PRODUCTS_PRICE' => xtc_format_price_order($order_data_values['final_price'],1,$order->info['currency']), 'PRODUCTS_QTY' => $order_data_values['products_quantity']); } // get order_total data $oder_total_query=xtc_db_query("SELECT title, text, class, value, sort_order FROM ".TABLE_ORDERS_TOTAL." WHERE orders_id='".$_GET['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'], 'CLASS'=> $oder_total_values['class'], 'VALUE'=> $oder_total_values['value'], 'TEXT' => $oder_total_values['text']); if ($oder_total_values['class']='ot_total') $total=$oder_total_values['value']; } // assign language to template for caching $smarty->assign('language', $_SESSION['language']); $smarty->assign('logo_path',HTTP_SERVER . DIR_WS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/img/'); $smarty->assign('oID',$_GET['oID']); if ($order->info['payment_method']!='' && $order->info['payment_method']!='no_payment') { include(DIR_FS_CATALOG.'lang/'.$_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); // dont allow cache $smarty->caching = false; $smarty->template_dir=DIR_FS_CATALOG.'templates'; $smarty->compile_dir=DIR_FS_CATALOG.'templates_c'; $smarty->config_dir=DIR_FS_CATALOG.'lang'; $smarty->display(CURRENT_TEMPLATE . '/admin/print_order.html'); // } else { // $smarty->display(CURRENT_TEMPLATE . '/error_message.html'); // } ?> 2.) In der Datei /shop/templates/meintemplate/admin/print_order.html die folgende Variable (oder wie man sagt) an die gew?nschte Stelle einf?gen. {$order_values.PRODUCTS_SINGLE_PRICE} Der Einzelpreis wird dann je Artikel und brutto (inkl. Mwst.) angezeigt. Hinweis: Es gibt auch noch eine /shop/print_order.php und /shop/templates/meintemplate/module/print_order.html. Ich wei? aber noch nicht wann, wo und ob diese Dateien aufgerufen werden. Diese habe ich jedenfalls nicht ge?ndert. ----------------------------------------- So, hoffentlich gibt es keine Fehler ;-) ------------------------------------------- Sch?nes Wochenende und bis demn?chst! Link to comment Share on other sites More sharing options...
subside Posted October 16, 2006 Report Share Posted October 16, 2006 hat das schon jemand probiert und kann sagen ob es auch für die gedruckte rechnung funktioniert? Link to comment Share on other sites More sharing options...
lolarennt Posted October 23, 2006 Report Share Posted October 23, 2006 Die Anleitung, die hier beschrieben wird, hilft nur bei der Integration der Einzelpreise im Adminbereich. Will man in der order_mail.html, also der Mail, die der Nutzer unmittelbar nach der Bestellung bekommt, die Einzelpreise einfügen dann muss man in der send_order.php in Zeile 69 folgendes einfügen: 'PRODUCTS_SINGLE_PRICE' => $xtPrice->xtcFormat($order_data_values['final_price']/$order_data_values['products_quantity'],true), Link to comment Share on other sites More sharing options...
MAD King Posted November 1, 2006 Report Share Posted November 1, 2006 Geht das auch mit den Nettopreisen? Link to comment Share on other sites More sharing options...
back@me Posted March 16, 2007 Report Share Posted March 16, 2007 Die Anleitung, die hier beschrieben wird, hilft nur bei der Integration der Einzelpreise im Adminbereich. Will man in der order_mail.html, also der Mail, die der Nutzer unmittelbar nach der Bestellung bekommt, die Einzelpreise einfügen dann muss man in der send_order.php in Zeile 69 folgendes einfügen: 'PRODUCTS_SINGLE_PRICE' => $xtPrice->xtcFormat($order_data_values['final_price']/$order_data_values['products_quantity'],true), Hi lolarennt, bist Du sicher, dass die Zeilen in der shop/send_order.php in Zeile 69 eingefügt werden müssen? Irgendwie funktioniert das nicht! Und in der order_mail.html kommt folgende Variable rein: {$order_values.PRODUCTS_SINGLE_PRICE} Danke back@me Link to comment Share on other sites More sharing options...
Sandfurz Posted March 27, 2009 Report Share Posted March 27, 2009 Hhm, die letzte Antwort ist zwar schon über zwei Jahre her, aber ich hänge mich trotzdem mal dran. Vielleicht kann mir einer von Euch ja sagen, ob und wie das auch in der "aktuellen" Version 3.0.4 SP2.1 funktioniert. Was mich nämlich wundert, ist, dass in meiner print_order.html die Variable für den Einzelpreis {$order_values.PRODUCTS_SINGLE_PRICE} zwar verwendet wird, in der Rechnung aber kein Einzelpreis angezeigt wird. Wo muss ich die denn wie definieren, damit das klappt? Ich danke Euch. Sandfurz EDIT: Äh, ok, ich rede von der print_order.html. Mein Vorredner von der oder_mail.html. Hhm, wo muss ich diese Variable denn nun überall einbauen? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.